|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
can I create new <input>'s after selecting an option?
Allo,
I was wondering if there was a way to create a specific amount of new <input type="text"> tags after selecting a number from a <select> form? For example, say I had 3 options in a select tag: <select> <option>1</option> <option>2</option> <option>3</option> </select> now, depending on which number I choose, it creates that amount of <input> fields for me to use in a form? Thanks! |
|
#2
|
||||
|
||||
|
yes, you can either do it client-side with javascript using document.write, or server-side with VBScript using Response.write.
|
|
#3
|
|||
|
|||
|
Do you want to add the inputs to the current document, or do you want to create a new document with those inputs?
|
|
#4
|
|||
|
|||
|
You can also use client-side script with vbscript. You would need to use DHTML.
|
|
#5
|
||||
|
||||
|
Quote:
However, it isn't recommended to use VBScript client-side, since not all browsers support VBScript as a client-side scripting language. |
|
#6
|
|||
|
|||
|
Never said that it was suggested, just said that it is possible to use
![]() |
|
#7
|
|||
|
|||
|
do you guys know how? or could direct me to a site that explains how? I'm not too familiar with Javascript or VB ;p
|
|
#8
|
|||
|
|||
|
This should work for javascript:
<script> function addInputElement(num){ inputElements.innerHTML=''; for(x=0;x<num;x++)inputElements.innerHTML=inputElements.inne rHTML +"<input value="+x+"><BR>" } </script> <P> <select name=select1 onchange='addInputElement( select1.value )'> <option value=0>none</option> <option value=1>one</option> <option value=2>two</option> <option value=3>three</option> </select> </P> <P> <form id=form1 name=form1> <div id=inputElements> </div> </form> </p> |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > can I create new <input>'s after selecting an option? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|