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



Home Answers Viewqa JavaScriptQuestions HOW TO DISPLAY 2 ROWS OF CONTROLS
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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

Advertisement
View Answers

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 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?  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
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?
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 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 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 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 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 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 string or character
How to display string or character  how to print character or a word without using array concept
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 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 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 add the calendar to the dynamic rows in html or jsp page - JSP-Servlet
how to add the calendar to the dynamic rows in html or jsp page  ...,no and i have 2 button in my jsp page ADD and delete button. when i click on add... can save the 2 or more row values at a time but i need to add the calenadar
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 add dynamically rows into database ?Need help pls
How to add dynamically rows into database ?Need help pls  Hi everyone, I really have a problem of insert multiple rows into the database.Now i can... cell2.appendChild(a); var cell3 = row.insertCell(2); var b
MySQL Affected Rows
MySQL Affected Rows This example illustrates how to show the affected rows... rows affected (0.08 sec)   Here update a table "...; Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0
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 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
Php Sql num rows
Php Sql num rows This example illustrates how to find number of rows... and find the number of rows of the table by mysql_num_rows methods. The output...);   $num_rows = mysql_num_rows($result);   
 

 

 

DMCA.com