Great bit of code, but of course all that is unnecessary if all Lee wants to do is capture the value of the select field:
<select name=blah onChange="document.forms[0].submit();"> And if supporting older browsers/JS-disabled browsers is important, putting this after the </select> tag is a good idea: <noscript> <input type=submit value=Go> </noscript> -Ron �_�.���) http://www.BookCrossing.com ~ Read and Release! (�`�.�_�. > -----Original Message----- > From: Don Vawter [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 27, 2001 1:55 PM > To: CF-Talk > Subject: Re: Ok.. JS gurus... > > > 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 > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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

