Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions HOW TO DISPLAY 2 SET OF CONTROLS

Have Programming Question? Ask it here!
 
 
 


SABARISH JAGANATHAN
HOW TO DISPLAY 2 SET OF CONTROLS
0 Answer(s)      10 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


Advertisement
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
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
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 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 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 about 2+5+"8"?
How about 2+5+"8"?  How about 2+5+"8
How to display string or character
How to display string or character  how to print character or a word without using array concept
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 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 the value of textfield constant
how to set the value of textfield constant  how to set the value of textfield constant
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 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
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
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
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 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 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 a file for 24 hours?
How to display a file for 24 hours?  How to display a file for 24 hours
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
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
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
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
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
how to display response in request page
how to display response in request page  Sir/Mom, My request page have three text boxes. Enter register number in the first box then click the submit button.This time shows the name and mark to display the second and third boxes
how to display records from database
how to display records from database  I want to display records from database in tables, the database is having 2000 records and i want to display 20 records at a time and to use next and previous link buttons to show
how to display pdf file on browser
how to display pdf file on browser   In my project i have created one pdf file(by pdfwriter) into my local mechine . after that it need to display in browser as a pdf file . but in jsp i can't display by iframe tag can anyone
 

 

 

DMCA.com