Set hidden values and then submit automatically

S

staeri

From my page shopping cart page I want to send the amount value to the
following payment page:

<script type="text/javascript">
window.onload = function (evt) { document.forms[0].submit(); }
</script>

</head>

<body>
<form name="payform" method="post"
action="https://mmm.com/payment/start.pml">
<input type="hidden" id="amount" name="amount" value=""
runat="server" />
<input type="hidden" name="merchant" value="752" />
</form>

The amount value should be set in the hidden input and then the form
should be submitted autmatically to the payment company. I have
problems capturing and setting the amount value.

I've tried with:

Sub Page_load()
amount.Value = 1212
End Sub

But I receive an error message from the payment company telling me that
amount is missing.

Can someone help me think clear?

Regards,

S
 
G

Guest

Did you check if the value is getting set in the hidden variable before
calling forms[0].submit function?

Regards,
Augustin
http://augustinprasanna.blogspot.com

From my page shopping cart page I want to send the amount value to the
following payment page:

<script type="text/javascript">
window.onload = function (evt) { document.forms[0].submit(); }
</script>

</head>

<body>
<form name="payform" method="post"
action="https://mmm.com/payment/start.pml">
<input type="hidden" id="amount" name="amount" value=""
runat="server" />
<input type="hidden" name="merchant" value="752" />
</form>

The amount value should be set in the hidden input and then the form
should be submitted autmatically to the payment company. I have
problems capturing and setting the amount value.

I've tried with:

Sub Page_load()
amount.Value = 1212
End Sub

But I receive an error message from the payment company telling me that
amount is missing.

Can someone help me think clear?

Regards,

S
 
G

Guest

From my page shopping cart page I want to send the amount value to the
following payment page:

<script type="text/javascript">
window.onload = function (evt) { document.forms[0].submit(); }
</script>

</head>

<body>
<form name="payform" method="post"
action="https://mmm.com/payment/start.pml">
<input type="hidden" id="amount" name="amount" value=""
runat="server" />
<input type="hidden" name="merchant" value="752" />
</form>

The amount value should be set in the hidden input and then the form
should be submitted autmatically to the payment company. I have
problems capturing and setting the amount value.

I've tried with:

Sub Page_load()
amount.Value = 1212
End Sub

But I receive an error message from the payment company telling me that
amount is missing.

Can someone help me think clear?

If you want to set it using page_load, could you not edit your HTML source
and use:

<input type="hidden" id="amount" name="amount" value="<%=intAmount%>"
runat="server" />

and declare and set intAmount somewhere else?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top