| | |
Adding textbox dynamically based on dropdown value
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 3
Reputation:
Solved Threads: 0
HTML code:
SCRIPT:
html Syntax (Toggle Plain Text)
<td><select name=select1 id="Expertise" name="Expertise" onChange=checkForm(document.form1.select1)> <option>Trained</option> <option>ProjectExp</option> <option>Certified</option> <option>ProjectExp & Certified</option></select> </td>
JavaScript Syntax (Toggle Plain Text)
function checkForm(type) { var a=type.selectedIndex if(a==1) {//code to add text fields } }
Last edited by peter_budo; Jun 30th, 2009 at 1:51 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
this is what you are looking for , i guess
hope it helps...
JSP Syntax (Toggle Plain Text)
<html> <head> </head> <script type="text/javascript"> function showdv(obj,id1,id2) { txt=obj.options[obj.selectedIndex].text; document.getElementById("box").style.display='none'; if(txt.match(id1)) { document.getElementById("box").style.display='block'; document.getElementById("boxx").value=txt } if(txt.match(id2)) { document.getElementById("box").style.display='block'; document.getElementById("boxx").value=txt } } </script> <body> <thead> <select id="opts" onchange="showdv(this,'one','two');" > <option value="">select</option> <option value="one">one</option> <option value="two">two</option> </select> </thead> <div id="box" style="display:none;"> <input Type="text" id="boxx" maxlength="20" > </div> </body> </html>
hope it helps...
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
![]() |
Similar Threads
- Please Help!!! Problems Adding Row Dynamically using Javascript (JavaScript / DHTML / AJAX)
- Adding a textbox dynamically (ASP.NET)
- need some help with a dynamically populated dropdown menu... (PHP)
- Saving textbox data based on date selected (VB.NET)
- Adding things to Array-Based Lists (C++)
- adding controls dynamically (VB.NET)
- dynamically filling dropdown from another dropdown (JavaScript / DHTML / AJAX)
- Adding Controls Dynamically (URGENT) (ASP.NET)
Other Threads in the JSP Forum
- Previous Thread: How to create tabs using jsp?
- Next Thread: Image Upload & Display Image
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web





