HOW TO DISPLAY 2 SET OF CONTROLS

Ads

 
 
 

Share on Google+Share on Google+

SABARISH JAGANATHAN
HOW TO DISPLAY 2 SET OF CONTROLS
0 Answer(s)      3 years and 8 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 GUYS HELP ME

Ads
View Answers
Ads









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
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 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 class path
how to set class path  how to set class path in java
How to set the cursor to wait?
How to set the cursor to wait?  How to set the cursor to wait
How to set cookies?
How to set cookies?  How to set cookies
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
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 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
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 display image with listview
how to display image with listview  How can i display the list view with the related images from database
How about 2+5+"8"?
How about 2+5+"8"?  How about 2+5+"8
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 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 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 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
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads