<html><DIV>Hi Everyone,</DIV>
<DIV> </DIV>
<DIV>I've been staring at my code to long and I'm stumped. I have a select menu (see
below) that is being populated from a databse. My problem is, if a user chooses
an option from the pull down menu it needs to also send the rest of my form variables
to the next page. Right now, using the 'onChange' handler, its only send the ID
variable within the 'option' tag. Now I know I can use the 'this.form.submit()' to
accomplish this but I cannot use it because I need the page to go somewhere different
when they press 'submit'. What would be cool is if I could dynamically change the
<form> tag to go one place when they click submit and another if they choose an
option from the pull down menu. I'm not well versed in Javascript, but I probably
could do it through Javascript. Any help will do.</DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV> function openURL(){ </DIV>
<DIV> // grab index number of the selected option<BR> selInd =
document.myForm.CompanyID2.selectedIndex; <BR> <BR> // get value of the
selected option<BR> goURL =
document.myForm.CompanyID2.options[selInd].value;<BR> <BR> // redirect
browser to the grabbed value (hopefully a URL)<BR> top.location.href = goURL;
<BR>}<BR>// end hiding script--></DIV>
<DIV> </DIV>
<DIV> <cfoutput><select name="CompanyID2"
onchange="openURL()"></cfoutput><BR>
<option value=""></option><BR> <cfoutput
query="GetCompanies"><BR>
<option value="index.cfm?ID=#ID#" <cfif IsDefined("ThisVar") AND
FORM.CompanyID2 IS NOT ''><cfif GetCompanies.ID IS
FORM.CompanyID2>selected</cfif></cfif>>#CompanyName#</option><BR> </cfoutput><BR>
</select></DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a
href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists