ColdFusionKing
Programmer
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 = "RentalForm.cfm";
document.the_form.submit();
}
function orderSubmit()
{
with (document.the_form) {
FirstName_hid.value = FirstName.value;
LastName_hid.value = LastName.value;
}
document.the_form.action = "OrderForm.cfm";
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" onclick="rentSubmit()">
<input type="button" name="Order" value="Order Form" onclick="orderSubmit()">
</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
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 = "RentalForm.cfm";
document.the_form.submit();
}
function orderSubmit()
{
with (document.the_form) {
FirstName_hid.value = FirstName.value;
LastName_hid.value = LastName.value;
}
document.the_form.action = "OrderForm.cfm";
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" onclick="rentSubmit()">
<input type="button" name="Order" value="Order Form" onclick="orderSubmit()">
</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