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 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 GUYS HELP ME

View Answers









Related Tutorials/Questions & Answers:
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 = '<
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
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
Display set names
Display set names  If i enter the First letter of a name it will display the list of names starting with that letter in command prompt using java   import java.util.*; class DisplaySetOfNames{ public static void
Display set of names from array
Display set of names from array In this section, you will learn how to display the set of names from array. In the given code, we have declared an array... element, it will display the set of countries name from the array. Example:ADS
Struts 2 imagae set to frame.
Struts 2 imagae set to frame.  I could not set image to frame in stuts 2. Here is the code : 1)index.jsp <%@ taglib uri="/struts-tags... could understand the reason . I want to set the image after uploading it please
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 set cookies?
How to set cookies?  How to set cookies
How to set the cursor to wait?
How to set the cursor to wait?  How to set the cursor to wait
how to set class path
how to set class path  how to set class path in java
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)%&
how to set the values in jsp
how to set the values in jsp  how to set the values text boxs in jsp frm dbase via servlet
Dynamically update the Label & set Bounds constant between 2 Label(Thread)
Dynamically update the Label & set Bounds constant between 2 Label(Thread... extends javax.swing.JFrame { private int q; private String r...=""; private String t2=""; public MyNew3( String t2,String t3,int q
Dynamically update the Label & set Bounds constant between 2 Label(Thread)
Dynamically update the Label & set Bounds constant between 2 Label(Thread... extends javax.swing.JFrame { private int q; private String r...=""; private String t2=""; public MyNew3( String t2,String t3,int q
Dynamically update the Label & set Bounds constant between 2 Label(Thread)
Dynamically update the Label & set Bounds constant between 2 Label(Thread... extends javax.swing.JFrame { private int q; private String r...=""; private String t2=""; public MyNew3( String t2,String t3,int q
how to set background image
how to set background image  how to set image in background in that image i want over lay text how it possible in jsp? using flash image how it is overlayed in jsp page? thanks
How to set NSZombieEnabled iPhone
How to set NSZombieEnabled iPhone  Hi, In my application I have to find and fix the object release issue. How to set NSZombieEnabled iPhone to find the bugs? Thanks   Hi, Please see the thread NSZombieEnabled iPhone
UINavigationController how to set title
UINavigationController how to set title  I want to set the tile of the UINavigationController when a view is displayed once new view is pushed. Thanks   Hi, You should use the following code
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
Display set of names in array when we press the first letter
Display set of names in array when we press the first letter  Please help to write a program which have to display set of names in the array when we click the starting letter (like in gmail if we press the letter it will show
How to set target to videos??
How to set target to videos??  Hi, i am developing project in HTML 5 with videos so, i am dispalaing videos in two table coloumn,if the video in one coloumn is clicked,it should be played in another coloumn. plzz suggest any idea
how set data in a dialog
how set data in a dialog  Button button = (Button) findViewById(R.id.button1); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setContentView
how to set image - EJB
how to set image   public ActionForward execute(ActionMapping mapping... in this pdf, how can i set pls help me sir, my image in E:/rose.jpg,how can set this jpg to my pdf file
Java set example
Java set example In this section you will learn about set interface in java. In java set is a collection that cannot contain duplicate element. The set... to add duplicate elements in the set. The set interface has method which
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 to set the value of textfield constant
how to set the value of textfield constant  how to set the value of textfield constant
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 Display Data in a tree structure on the GUI
How to Display Data in a tree structure on the GUI  how to display data in a tree structure on the GUI? I need this sort of UI to display data showing a set of rules showing various conditions and the actions related
ModuleNotFoundError: No module named 'controls'
'controls' How to remove the ModuleNotFoundError: No module named 'controls...ModuleNotFoundError: No module named 'controls'  Hi, My Python... to install padas library. You can install controls python with following
How to add a columns with a button set to a Jtable built with database result set
How to add a columns with a button set to a Jtable built with database result set  hi, i have to build a gui to display account numbers and account... that button column to the table which is built with database result set. i would thank
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 to set folder size in php
how to set folder size in php  hi , i know how to create folder but i dont know how to set size for folder did u know means tell me. thankyour
how to set time in jsp page
how to set time in jsp page   I need code for set the time in jsp code .iam using struts frame work back end oracle 10g ide is eclipse 6.0
how to set size of button,textfield.
how to set size of button,textfield.  how we set size of button... large how to set as a preferd size in the panel or frame .when we click maximize button not effect on text or button to their of size the set on the prefered
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 set Marathi font to Label??
How to set Marathi font to Label??  Hello, I am doing one project in java-Swing Farm Management i want to set Marathi label in that so how i can? plzzzz help me its urgent
Java Set iterator with example
Java Set Interface keeps the data without duplicate value. Its one subtype... Set Iterator import java.util.*; public class setiterator { public static void main(String[] args) { Set s = new TreeSet(); s.add(1000); s.add
Java Set Iterator
Set Interface keeps the data without duplicate value. Its one subtype... data. It uses iterator() method to traverse the data Java Set Iterator...(String[] args) { Set s = new HashSet(); s.add("car
How to display a file for 24 hours?
How to display a file for 24 hours?  How to display a file for 24 hours
Data Provider Controls in Flex
Data Provider Controls in Flex       All list based controls and many of the Flex framework controls are called data provider controls since they represent data from a data provider. All
How to set placeholder in uitextfield programmatically?
How to set placeholder in uitextfield programmatically?  Can any one tell me about the example code for setting the placeholder in a UITextField programatically? Thanks   HI, Its easy. Use the following code
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 display the data column on jsp
How to display the data column on jsp  My requirements: Display total... with this situtaion. should i set the data in a pojo and display the data in row wise... is dynamic. one database having 2 rows and another database could have 10 rows. so
how to set value of dropdown list
how to set value of dropdown list  Hello Sir, I'd solved the earlier problems somehow but now this time another problem arised when I want to pass the value from a link to a dropdown list. I want to set the dropdown list selected
how to set value of dropdown list
how to set value of dropdown list  Hello Sir, I'd solved the earlier problems somehow but now this time another problem arised when I want to pass the value from a link to a dropdown list. I want to set the dropdown list selected
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

Ads