javascript -> form

O

otto

i need to read a variable in a javascript and translate it to a form in
html

the javascript variable is:

<SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script>

and i need to put that variable as the value in this line
<input type="hidden" name="AMT" value="**">

Is this possible. can i combine these 2 lines?

Thanks,
otto
 
O

otto

<SCRIPT LANGUAGE='JavaScript'>document.FormName.AMI.value=RF2N('Total');
</script>

Thanks for your reply!

unfortunately it doesn't work for me. This is my code:


<td align=right>
<font face="arial" size=2
color=#000000 class="esm_ty_font"><h4>
<SCRIPT
LANGUAGE='JavaScript'>RF2N('Total');</script>
</h4>
</td>
</tr>
</table>
</td>
</tr>
</table>

<p><!-- The Way2Pay Button HTML begint hier -->
<form action="https://merchant.way2pay.nl/merchant/payments-w2p.asp"
method=post id=form1
name=form1>
<input type="hidden" name="MERID" value="xxxxxxx">
<input type="hidden" name="MNAME" value="xxxxxxx">
<input type="hidden" name="ITEMNAME" value="Bestelling">
<input type="hidden" name="TID" value="orderID">
<SCRIPT LANGUAGE='JavaScript'>document.formName.AMT.value=RF2N('Total');
</script>
<input type="hidden" name="SURL" value="http://www.nu.nl">
<input type="hidden" name="FURL" value="http://www.nu.nl">
<input type="image" border="0" name="IMAGEFIELD"
src="https://www.way2pay.nl/pix/voorstel1/betaalnu_klein2_nieuw.gif"
alt="Betaal met
Way2Pay">
</form>
<!-- The Way2Pay Button HTML eindigt hier -->&nbsp; </p>



-----

The javascript on the third line prints the total amount of the order. The
javascript call in the form sets a value of 0 to AMT.
the orginal line in the form is
<input type="hidden" name="AMT" value="XX">

any idea's?

Thanks for all your help.
Otto
 
H

Hywel Jenkins

ojl66 said:
i need to read a variable in a javascript and translate it to a form in
html

the javascript variable is:

<SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script>

and i need to put that variable as the value in this line
<input type="hidden" name="AMT" value="**">

Is this possible. can i combine these 2 lines?

<SCRIPT LANGUAGE='JavaScript'>document.FormName.AMI.value=RF2N('Total');
</script>
 
D

David Dorward

what is it what i'm doing wrong here?

While the form you are tying to use now exists, I can't see any sign of the
field that you are trying to set the value for.
 
S

Steve Pugh

otto said:
<p><!-- The Way2Pay Button HTML begint hier -->
<form action="https://merchant.way2pay.nl/merchant/payments-w2p.asp"
method=post id=form1
name=form1>
<input type="hidden" name="MERID" value="xxxxxxx">
<input type="hidden" name="MNAME" value="xxxxx">
<input type="hidden" name="ITEMNAME" value="Bestelling">
<input type="hidden" name="TID" value="orderID">

<SCRIPT LANGUAGE='JavaScript'>document.form1.AMT.value=RF2N('Total');
</script>

This is telling the browser to change the value of the input AMT, but
there is no input AMT for it to change. Add the input AMT and then
this script will be able to set it's value as instructed.

<input type="hidden" name="SURL" value="http://www.nu.nl">
<input type="hidden" name="FURL" value="http://www.nu.nl">
<input type="image" border="0" name="IMAGEFIELD"
src="https://www.way2pay.nl/pix/voorstel1/betaalnu_klein2_nieuw.gif"
alt="Betaal met
Way2Pay">
</form>

Steve
 
O

otto

thanks for all the help, but i'm totally lost.

The line <SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script>
print the correct amount on screen. I.m.o. this RF2N('Total')variable exists
and is correct.

What i want is to fill the new AMT variable in the script with the exact
value of the RF2N('Total') variable.

The line <SCRIPT LANGUAGE='JavaScript'>document.form1.AMT.value=RF2N
('Total');</script> in the form seems to fail to do this tric.

any ideas?
Thanks,
otto
 
S

Steve Pugh

otto said:
thanks for all the help, but i'm totally lost.

The line <SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script>
print the correct amount on screen. I.m.o. this RF2N('Total')variable exists
and is correct.

Yes. So long as the user has JavaScript enabled....
What i want is to fill the new AMT variable in the script with the exact
value of the RF2N('Total') variable.

There is no AMT variable.
The line <SCRIPT LANGUAGE='JavaScript'>document.form1.AMT.value=RF2N
('Total');</script> in the form seems to fail to do this tric.

document.form1.AMT.value=RF2N('Total')

This means set the value of the input named AMT in the form named
form1 to the output of the function RF2N.

Your form does not have an input named AMT.
Include one and it will work.

Steve
 
N

nice.guy.nige

<SCRIPT
LANGUAGE='JavaScript'>document.FormName.AMI.value=RF2N('Total');
</script>

Erm... <script type="text/javascript"> ? Or <script language="javascript"
type="text/javascript"> Without the type attribute the code won't validate,
as I'm sure you know! ;-)

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. (e-mail address removed). Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
"They got the mustard out!"
 
O

otto

Your form does not have an input named AMT.
Include one and it will work.

Steve

Thanks Steve,

I use this code now:

<input type="hidden" name="AMT" value="">
<SCRIPT LANGUAGE='JavaScript'>document.form1.AMT.value=RF2N('total');
</script>

unfortunately i get an error message at the paysite. When i remove the
input ..hidden line, i get no error message but amount is 0.

when i only use <input type="hidden" name="AMT" value="999,99">
amount is corectly set at paysite to 999,99

the line <SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script> prints the
amount correctly in my form

thanks for the help !
 

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

No members online now.

Forum statistics

Threads
474,342
Messages
2,571,407
Members
48,796
Latest member
katerack

Latest Threads

Top