I am trying to use an HTML Select form component to select & go to a URL.
I'm using the attached jQuery to accomplish this. The selection opens a new
window to the intended URL but the submit function doesn't post the hidden
name/value pairs. I suspect my syntax is a bit in conflict since the submit
function isn't working as expected. When I pull the window.location nothing
happens.

After googling "jquery select post" and related combinations, I haven't
solved this one yet so thought I'd check here since CF programmers
frequently use jQuery.

Thanks in advance.

 <script>
  $(function(){
   $('##dynamic_select').bind('change', function(){
    var url = $(this).val();
    if(url){
     window.location = url;
     $("##myForm")
      .attr("action", url)
      .attr("target", "_blank")
      .submit(function(){return false;});
    }
    return false;
   });
  });
</script>

<form method="post" action="##" id="myForm" name="myForm">
<input type="hidden" name="formTest" value="TEST" />

<select id="dynamic_select">
<option value="" selected="selected">Navigate too ...</option>
<option value="/index.cfm?action=test.pageLib">Library</option>
<option value="/index.cfm?action=test.pageSchool">School</option>
<option value="/index.cfm?action=test.pageHist">History</option>
</select>

</form>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355868
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to