Auto populate text field from list
I have a list and i want to show the value of the list in the text field next to it.
How do i go about doing this ?
Any webassist tools could help with it?
Thanks!
I have a list and i want to show the value of the list in the text field next to it.
How do i go about doing this ?
Any webassist tools could help with it?
Thanks!
i did a test page with something like this a while ago, (a bit clunky to look at but it does the job)
depending on the option chosen, a label is updated by a javascript function.
it isn't a text box as you requested, but this may help.
you should be able to view the javascript if you have firebug.
gallerydetailstest.php?ImageID=17
here is a sample script showing ho to pupulate a text box with the valu of the selected item and another with the lable of the selected itemL
<form id="form1" name="form1" method="post" action="">
<select name="selectList" id="selectList" onChange="document.form1.txtLable.value = document.form1.selectList[document.form1.selectList.selectedIndex].text; document.form1.txtValue.value = document.form1.selectList[document.form1.selectList.selectedIndex].value">
<option value="">Please make a selection</option>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
<option value="5">five</option>
</select>
Lable
<input type="text" name="txtLable" id="txtLable" />
Value
<input type="text" name="txtValue" id="txtValue" />
</form>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.