Mike,
This will change a Select drop box to a text input
based on the user selecting "other" from the drop down.
This is so the user can "type" in a value if it is not in the select.
Maybe this can give you some clues.
Dave
watch the wrap.
Here is the function:
function changeInputType(x,y){
var d=document, C=(d.createElement)?d.createElement:0;
var y;
if(C){
if(d.all) d=C('<input name='+x.name+ ' id=Fields_90_Yellow'+ '>');
else{ d=C('input'); d.type='text'; d.name=x.name}
d.value=x.options[x.options.selectedIndex].text;
x.replaceNode(d)}}
Here is the Select.
<select name="Color"
onChange="if (this.value == 'OTHER')changeInputType(this);">
<option value="RED">RED</option>
<option value="GREEN">GREEN</option>
<option value="BLUE">BLUE</option>
<option value="----">----</option>
<option value="OTHER">OTHER</option>
</select>
----- Original Message -----
From: "Michael Wilson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 30, 2002 4:19 PM
Subject: OT: Totally OT JavaScript Q
> Hi all,
>
> Sorry for the off topic post, but I was wondering if anyone knew of a
> way to change the "type" of a form input on the fly, using JavaScript.
> For example; I know I can change the value of "value" thusly:
> onFocus="this.value='My New Value'". I was hoping I could change the
> input type from text to password, onFocus. Of course
> onFocus="this.type='password'" did not work for me and I am, in all
> probability, delusional. :-) Any help would be appreciated!
>
> Mike
>
>
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists