I'm assigning the form field values to hidden variables because it is a 4 pages form and I am passing the values from one page to another in hidden variables. I have chceked the code in both the action pages, they both have the same code, I just don't understand what's happenning here, I've turned debugging on. One another thing I've noticed is if I remove the "id" attribute from the text input fields, I get a _javascript_ error when submitting the form (form variable FirstName is not undefined). I thought the "id" attribute was optional. Any ideas?

>okay I copied your code and made a rental and order page. the page submits
>fine to either page depending on which button I press. One thing I dont
>understand is why you are assingning the values from a form field that is
>already being passed into a hidden field that is also passed?
>
>couldnt you do this in the js functions?
>
> function rentSubmit()
>  {
>    document.the_form.action = ""> >    document.the_form.submit();
>  }
>
> function orderSubmit()
>  {
>   document.the_form.action = ""> >    document.the_form.submit();
>  }
>
>but, either way it seems to be submitting fine. i guess you could check the
>syntax of your dump statement on the one page, and also turn debugging on to
>see  the form variables being passed.
>
>hope this helps.
>
>
>
>-----Original Message-----
>From: Allan Clarke [mailto:[EMAIL PROTECTED]
>Sent: Monday, November 03, 2003 10:06 AM
>To: CF-Talk
>Subject: form variables not passed to action page - please help!
>
>
>Hi Guys,
>Am really hoping for someone to help me. I have this
>problem and can't find a solution. I have a form with
>two buttons with an onClick event each. Each button
>calls a _javascript_ function. When the user clicks on
>the button, I'm assigning all form field values to
>hidden variables. When I dump the form values on the
>action page,
>I see the form field values (including hidden form
>field values) for button 1, but don't see the same
>when button 2 is clicked. Here is my code
>            
><script LANGUAGE="_javascript_">
>
>  function rentSubmit()
>  {
>     with (document.the_form) {
>        FirstName_hid.value = FirstName.value;
>      LastName_hid.value = LastName.value;
>    }
>    document.the_form.action = ""> >    document.the_form.submit();
>  }
>
>  function orderSubmit()
>  {
>  with (document.the_form) {
>      FirstName_hid.value = FirstName.value;
>    LastName_hid.value = LastName.value;
>  }
>    document.the_form.action = ""> >    document.the_form.submit();
>  }
>  
>  </script>
>            
><form name="the_form" method="post">
><input type="text" name="FirstName" id="FirstName"
>value="" size="56"><br>
><input type="text" name="LastName" id="LastName"
>value="" size="56">
>               
><input type="hidden" name="FirstName_hid" value="">
><input type="hidden" name="LastName_hid" value="">
>               
><input type="button" name="Rent" value="Rental Form"
>> ><input type="button" name="Order" value="Order Form"
>> ></form>
>
>When I click on the "Rent" button, I am taken to
>RentalForm.cfm. In this file, I have a
><cfdump var="#form#">
>It dumps all the form variables as I expect it to. But
>when I click on the "Order" button, I get directed to
>OrderForm.cfm but the cfdump on that page displays
>nothing. I don't understand why I don't see the form
>variables? Can somebody show/tell me how to fix this
>problem.
>
>Many Thanks,
>Allan
>
>__________________________________
>Do you Yahoo!?
>Exclusive Video Premiere - Britney Spears
>http://launch.yahoo.com/promos/britneyspears/
><http://launch.yahoo.com/promos/britneyspears/>  
>  _____  
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to