Share on Google+Share on Google+

Nishit Ranjan
For every option selected from a dropdown a new textbox opens
2 Answer(s)      4 years and 11 months ago
Posted in : HTML

I have a dropdown with four options, each time I select an option a new text box should open below. please guide.In urgent need.

Ads

View Answers

May 15, 2012 at 5:03 PM


The given code displays the dropdown list and allow the user to use onchange event. As the user clicks the button, everytime a textbox will get displayed.

<html>
<script>
function generateTextbox(){
var d=document.getElementById("div");
d.innerHTML+="<p><input type='text' name='lang'></p>";
}
</script>
<select name="sel" onchange="generateTextbox();">
<option value="C/C++">C/C++</option>
<option value="Java">Java</option>
<option value="Pascal">Pascal</option>
<option value="Perl">Perl</option>
</select>
<br>
<div id="div">
</div>
</html>


May 16, 2012 at 10:16 AM


but I dont want the textboxes to accumulate.one textbox every time an option is selected.










Related Tutorials/Questions & Answers:
For every option selected from a dropdown a new textbox opens
For every option selected from a dropdown a new textbox opens  I have a dropdown with four options, each time I select an option a new text box...;   but I dont want the textboxes to accumulate.one textbox every
how to display textbox value based on selected option value?
how to display textbox value based on selected option value?  Hi,I have some problem. I use jsp and ajax. first select: 1 second select:2 based...(); String data=""; ResultSet rs = stmt.executeQuery("Select * from DOCTOR
Advertisements
How to backup a selected file from the dropDown Menu in JSP?
How to backup a selected file from the dropDown Menu in JSP?  I am trying to create a dropdown menu list for some type of files contained ina directory and upon selecting one, I'll have a click button backFile to copy the selcted
. Display JavaScript dropdown selected value
. Display JavaScript dropdown selected value  How to get the selected value from dropdown box? I am using javascript.   <html> <...("dropdown").value; alert("You selected : " + dropdownValue); } <
How to open textfields in the the same panel of the jframe by selcting from dropdown menu option ...
of option from the dropdown menu .acc. to my requirement i have to show...How to open textfields in the the same panel of the jframe by selcting from dropdown menu option ...  Hello Sir, I have a dropdown menu
binding data with textbox on dropdown click
binding data with textbox on dropdown click  Hello friends,Divyesh here. i have jsp page and i would like to bind data with text box on dropdown click. in dropdown employee id are load.and when we select perticular id than how
Javascript get Date And Selected Option Text
Javascript get Date And Selected Option Text In this tutorial we will learn about how to get Date from the textbox and displayed as Date as well as how to get the selected option text and displayed in Javascript. This tutorial
<html:option > with "selected" attribute - Struts
with "selected" attribute  how to display formbean object with "selected" attribute in . please help me
dropdown vlaue changes based on input given in textbox uisng AJAX
dropdown vlaue changes based on input given in textbox uisng AJAX  hi, In my app i need one textbox based on textbox data, values in dropdown list have to change and dropdown data retreive data from database thanks KK
How to Fetch Data using dropdown option
How to Fetch Data using dropdown option   sir maine jsp pr ek login page banaya jismain branch ka option hai. main agar first dropdown main first year branch select karta hoon to first year ki sari branches ki list second drop
Inserting values into a database table of selected DropDown in jsp.
Inserting values into a database table of selected DropDown in jsp.  ... to insert all selected values in data base correspondent to each like if user selected india and then goa. I want to insert it to a table which has two fields
display he new customer no in textbox
display he new customer no in textbox   i want to add the new customer for that when i click on add butto the new customernumber should be display in textfield . plz ell me the suggestions & code
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB
Dynamically display values in dropdown box and then show the selected values... trying to display multiple selection selected from the list of all the values...)) { System.out.println("Status matches !!! ); jspw.println("<option selected
changes in netbeans/ browser so that each application run opens in a new window of browser
changes in netbeans/ browser so that each application run opens in a new window of browser  hieeee... I want to change netbeans setting. So that each time i run an application it opens up in a new window rather than a new tab
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP  as i said i want to create 3 drop dropdown list each depend on the other and get the options from
dropdown
dropdown  how to hide textbox field when i deselect from select dropdown
include a delete option in every row of table in a JSP page
include a delete option in every row of table in a JSP page  I have..." sql="select* from login"> </sql:query> <html> <... on Delete it should delete the particular record from the database and reflect
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB
Dynamically display values in dropdown box and then show the selected values... this code it is adding one more value to the dropdown box and showing as selected. so if I have 5 values in the dropdown this selected one is added as 6th values
getting values from dropdown list
getting values from dropdown list  I am having a dropdown list which has hardcoded values ( we need it hardcoded only and will not be populated from... the selected value to the action. Please can any one please help me out
Dropdown code to retrieve result from oracle database
that will retrieve values from the database into dropdown. As the user choose any option from the dropdown, corresponding values will get displayed in the textboxes...Dropdown code to retrieve result from oracle database  Hi Friends, I
How to automatically change the value of the textbox based on the dropdown list?
How to automatically change the value of the textbox based on the dropdown list..._in"); session.setAttribute("s_in",s_in); java.text.DateFormat df = new java.text.SimpleDateFormat...=con.prepareStatement("Select item_name from items order by item_name
populating textbox value from the database using onchange function,
populating textbox value from the database using onchange function,  ... selecting from dropdownlist. i have a form in jsp n I created the dropdown list.... but the next textbox value is populated from database. plz help me guys
display data from database in textbox when id entered in textbox
display data from database in textbox when id entered in textbox  i wanted to enter data in textbox .depending on entered data in textbox data from database should be displayed dynamically in textbox
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
Dynamically Update textbox from database
Dynamically Update textbox from database  I have a database as shown... with two text boxes. if I type something in one textbox, the corresponding value to that typed value from database has to be displayed in another text box
3 dropdown list from the database using JSP
3 dropdown list from the database using JSP  Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP
How to show autocomplete textbox values on combo box option selection using database?
How to show autocomplete textbox values on combo box option selection using database?  When I select option(i.e First Year) then it will show list of student names in auto-complete text box
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.  The code for retrieving data from database into Drop Down List. <% DataSource data = new
Tutorials   
Java Spring Hibernate Struts Training How to display button as a link in vaadin? hi change navbar dropdown color in bootstrap How to remove the background color of bootstrap menu bar? How to change color of opened Bootstrap drop down toggle? Setting bootstrap container background color Help school all activities and admision process.. add one row after another date make a webpage HTMl HTMl Source code how to apply globalisation to a world wide asp.net application how to print HTML using javascript or Jquery How to recover from google panda update? How to survive google panda 4.0 update How to find if you have been hit by Panda 4.0 Design a web page using XHTML and JavaScript that does the followings: ffmpeg converting file mp4 to mov JavaScript How to Disable Catch-all Emails on CPanel z-index always on top What is Web hosting Database and HTML web development trainee Uploading files Image Gallery Image Gallery dropdown How to redirect from a HTML page? Easiest method for expiring the css and js headers HTML WITH AJAX VB 6 Read Web Page Header string palindrom using vbscript? html button How to add mod_deflate to apache without recompiling How to use place hoder in IE(version : 8) Html Software Question div align left css Fetching data from excel file on other website and display in interactive graph form where do I find the fix for tree view catalog not expanding and collapsing correctly for roseindia shopping cart 1.1 pass to next page to enter into a particular page only if the username,password and listbox value mtches hi Cricket stadium ticket booking design Need some help creating an order form. HTML div tag HTML div tag

Ads

 
Advertisement null

Ads