I assume you mean populate a hidden field rather than create a hidden field
correct?

<select name="blah" onChange="foobar(this);">

function foobar(obj){
    with (obj){
        for(i=0;i<options.length;i++){
            if(options[i].selected){
                document.forms[0].hiddenfield.value=options[i].value;
                break;
            }
      }
    }
   document.forms[0].submit();
}

I haven't tested this but I think it should work

----- Original Message -----
From: "Lee Fuller" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 27, 2001 12:35 PM
Subject: OT: Ok.. JS gurus...


> Since we seem to be on the subject, I can't get anything to work, and
> thought someone (prolly Dave <grin>) might have an answer for this...
>
> Need to include a drop-down in a form that, when changed (onchange),
> will add a hidden field to the form, and submit it immediately.
>
> Send me somewhere to find it.. That's ok! ;)  Just need to figure it
> out.
>
> TTAIA
>
> Lee
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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

Reply via email to