HOW TO DISPLAY 2 ROWS OF CONTROLS

Ads

 
 

Share on Google+Share on Google+

SABARISH JAGANATHAN
HOW TO DISPLAY 2 ROWS OF CONTROLS
0 Answer(s)      4 years and 2 months ago
Posted in : JavaScript Questions

i can be display one row by selecting value from drop down box BUT ALSO i need to display 2 rows by selecting value from drop down box of textbox's and radio button,drop down box using this code

<html>
<head>
<title>Dynamic Form</title>
<script type="text/javascript" >
function refresh()
{
location.reload(); 
}

function CreateTextbox()
{
var b=document.form.drop.value;
var html = "<table id='table1'><tbody><tr><td><td><td><td>NAME</td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>AGE</td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>GENDER</td><td><td><td><td><td><td><td><td><td><td>BERTH</td><td><td><td><td><td><td><td><td><td><td><td><td>SENIOR CITEZEN</td></tr></tbody></table>";
document.getElementById('div1').innerHTML = html;
var tr = document.createElement('tr');
var td = document.createElement('td');
//td.innerHTML = 'ABC';
tr.appendChild(td);
var s = tr.innerHTML;
tr.innerHTML = s;
if(b==1)
{
tr.innerHTML = '<td><td><td><td>' + "<input type=text name='name1' placeholder='n'/>" +'<td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type=text name='age' placeholder='a'/>"+'<td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type='radio' name='gen' value='male' />"+"MALE"+'<td>'+"<input type='radio' name='gen' value='male' />"+"FEMALE"+ '<td><td><td><td><td><td><td><td><td>'+"<select> <option value='lb'>Lower Berth</option><option value='up'>upperberth</option> <option value='ws'>window seat</option> <option value='nc'>no choice</option> </select>"+'<td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type='checkbox' name='sen' onclick='val()'+i/>"+'</td>';

var tbody = document.getElementById('table1').getElementsByTagName('tbody')[2];
tbody.appendChild(tr);
}
else if(b==2)
{
tr.innerHTML = '<td><td><td><td>' + "<input type=text name='name1' placeholder='n'/>" +'<td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type=text name='age' placeholder='a'/>"+'<td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type='radio' name='gen' value='male' />"+"MALE"+'<td>'+"<input type='radio' name='gen' value='male' />"+"FEMALE"+ '<td><td><td><td><td><td><td><td><td>'+"<select> <option value='lb'>Lower Berth</option><option value='up'>upperberth</option> <option value='ws'>window seat</option> <option value='nc'>no choice</option> </select>"+'<td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type='checkbox' name='sen' onclick='val()' +i/>"+'</td>';
var tbody = document.getElementById('table1').getElementsByTagName('tbody')[0];
tbody.appendChild(tr);
}
else if(b==3)
{
tr.innerHTML = '<td><td><td><td>' + "<input type=text name='name1' placeholder='n'/>" +'<td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type=text name='age' placeholder='a'/>"+'<td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type='radio' name='gen' value='male' />"+"MALE"+'<td>'+"<input type='radio' name='gen' value='male' />"+"FEMALE"+ '<td><td><td><td><td><td><td><td><td>'+"<select> <option value='lb'>Lower Berth</option><option value='up'>upperberth</option> <option value='ws'>window seat</option> <option value='nc'>no choice</option> </select>"+'<td><td><td><td><td><td><td><td><td><td><td><td>'+"<input type='checkbox' name='sen' onclick='val()'+i/>"+'</td>';
var tbody = document.getElementById('table1').getElementsByTagName('tbody')[0];
tbody.appendChild(tr);
}
else
{
alert("asds");
}
}
</script>
</head>
<body>
<form name="form" action="post" method="">
<input type="button" value="REFRESH" onclick='refresh()' >
<select name="drop" onchange='CreateTextbox()'>
<option value="-1">select</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option></select>
<div id="div1">
</div>

</form> 
</body>
</html>

please help me guys
Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
HOW TO DISPLAY 2 ROWS OF CONTROLS
HOW TO DISPLAY 2 ROWS OF CONTROLS  i can be display one row by selecting value from drop down box BUT ALSO i need to display 2 rows by selecting...').getElementsByTagName('tbody')[2]; tbody.appendChild(tr); } else if(b==2) { tr.innerHTML
HOW TO DISPLAY 2 SET OF CONTROLS
HOW TO DISPLAY 2 SET OF CONTROLS  i can be display one row by selecting value from drop down box BUT ALSO i need to display 2 rows by selecting value...').getElementsByTagName('tbody')[2]; tbody.appendChild(tr); } else if(b==2) { tr.innerHTML = '<
Advertisements
How to align controls?
How to align controls?  How do I set LEFT,TOP,etc type of properties of a control at run time
How to display all the rows in JSP ,MySQL select condition statement IN dept_table
How to display all the rows in JSP ,MySQL select condition statement IN dept_table  I iam unable to display all the rows in JSP select statement from... is as follows.Plz help me to display all the rows that satisfy the condition
How to sort the rows in SQL?
How to sort the rows in SQL?  How to sort the rows in SQL?   Hi, Here is the answer, The ORDER BY clause allows you to sort the records in your result set. The ORDER BY clause can only be used in SELECT statements
How to insert rows in jTable?
How to insert rows in jTable?  Hi, I need to take input from user using JTable. I want an empty row to appear after clicking a insert button... not figure out how to. I used DefaultTableModel but wasnt able to insert a row
how to display?
how to display?  How to write a select query for displaying data where i have author as multivalued attribute
how to display?
how to display?  How to write a select query for displaying data where i have author as multivalued attribute
how to display?
how to display?  How to write a select query for displaying data where i have author as multivalued attribute
how to search the string arraylist contains database rows?
how to search the string arraylist contains database rows?  i need to search 2 database. one is excel database and another is SQL database. stored the row values into string arraylist. now i want to print the common rows existed
how to display?
how to display?  I have to write a code for searcing books in library...;search.jsp</strong> <body> <table border=2> <tr> <th>...)%&gt; &lt;/td&gt; &lt;td&gt; &lt;%=rs.getString(2)%&
Show multiple identical rows into JTable from database
Show multiple identical rows into JTable from database In this tutorial, you will learn how to display the multiple rows from database to JTable. Here... rows from database on clicking search button to jtable. The given code accepts
how to display image with listview
how to display image with listview  How can i display the list view with the related images from database
How to display date in JSP?
How to display date in JSP?  How to create a simple JSP program which displays date on the page? Thanks
How to display string or character
How to display string or character  how to print character or a word without using array concept
How about 2+5+"8"?
How about 2+5+"8"?  How about 2+5+"8
HOW TO DISPLAY TABLEEEE
HOW TO DISPLAY TABLEEEE  Please teach me how to display table step by step like a kid who didnt know anything? please !! I try so many times but it is not working out ! S.O.S !!! HELP ME PLEASEEEE
how to Insert Array Values Into Separate Rows using java?
how to Insert Array Values Into Separate Rows using java?  how to Insert Array Values Into Separate Rows using java?  class...) { String array[][]={{"1","Angel","Delhi"},{"2","John","Chennai"},{"3","William
How to display the data column on jsp
How to display the data column on jsp  My requirements: Display total... is dynamic. one database having 2 rows and another database could have 10 rows. so...), rs.getString(2)); //errorCountList1.add(rs.getString(2
How to display date in JSP?
How to display date in JSP?  How to create a simple JSP program which displays date on the page? Thanks   Hi, You should import...() %> Check complete tutorial at How to Create JSP Page? Thanks
How to display the current time
How to display the current time  I was develop online web portal. In this web portal i am going to display time. I am using <%= new java.util.Date() %> to display the time. But it display the time after that cannot changed
How can we find the number of rows in a result set using PHP?
How can we find the number of rows in a result set using PHP?   How can we find the number of rows in a result set using PHP
how to select random rows from database through servlet
how to select random rows from database through servlet  hello i want to know, how to select random rows from database through servlet
how to mark different colors for diffent rows - Java Beginners
how to mark different colors for diffent rows  Hi frends, Actually yesterday i had a question that, how can i mark colors to my rows in the table... question is how can i solve this problems means my table should have colored rows
How to display a file for 24 hours?
How to display a file for 24 hours?  How to display a file for 24 hours
In Struts 2 how to pass the <s: property value=''
In Struts 2 how to pass the s: property value'  In Struts 2 how to pass the s: property value' I have page where i display the list of treasury... this data.jsp from that DB and display the same in a page. How do i send
how to display multiple images on browser
how to display multiple images on browser  i want to display multiple images on brower including string values from sql database using jsp
how to display multiple images on browser
how to display multiple images on browser  i want to display multiple images on brower including string values from sql database using jsp
How to insert rows from Excel spreadsheet into database by browsing the excel file?
How to insert rows from Excel spreadsheet into database by browsing the excel file?  I want to insert rows from excel sheet to database.for this i... the excel file using file browsing dialogue through form in JSP. How can i select
how to display the email message in jsp
how to display the email message in jsp  hi every one .. i am new from this industry please help me to display the email message in jsp page please send me sample code
How to display windows virtual keyboard
How to display windows virtual keyboard  Hi, I have a jsp file which contains my website design. In my jsp website design, there's a button. I need to display windows virtual keyboard when i press the button. how to do

Ads

 
Advertisement null

Ads