Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > javascript -> form

Reply
Thread Tools

javascript -> form

 
 
otto
Guest
Posts: n/a
 
      06-30-2003
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
 
Reply With Quote
 
 
 
 
otto
Guest
Posts: n/a
 
      06-30-2003
>
> <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

 
Reply With Quote
 
 
 
 
Hywel Jenkins
Guest
Posts: n/a
 
      07-01-2003
In article <Xns93AAB8E1FC63Bojl66gmxnet@194.109.133.29>, ojl66
@NOSPAMgmx.net says...
> 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>

--
Hywel Never knowingly understood
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      07-01-2003
otto wrote:
> unfortunately it doesn't work for me. This is my code:


<snip>

You have _lots_ of syntax errors.

http://validator.w3.org/

(You also try to be trying to use JS to set the value of a non-existant
field in a non-existant form)

--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      07-01-2003
otto wrote:

>> (You also try to be trying to use JS to set the value of a non-

> existant
>> field in a non-existant form)


> 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.


--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      07-01-2003
otto <(E-Mail Removed)> wrote:

><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=RF2 N('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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
otto
Guest
Posts: n/a
 
      07-01-2003
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=RF2 N
('Total');</script> in the form seems to fail to do this tric.

any ideas?
Thanks,
otto



 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      07-01-2003
otto <(E-Mail Removed)> wrote:

>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=RF2 N
>('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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
nice.guy.nige
Guest
Posts: n/a
 
      07-01-2003
While the city slept, Hywel Jenkins <(E-Mail Removed)> feverishly
typed:

> <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. http://www.velocityreviews.com/forums/(E-Mail Removed). Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
"They got the mustard out!"


 
Reply With Quote
 
otto
Guest
Posts: n/a
 
      07-01-2003
>
> 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=RF2 N('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 !
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve form field value if form is EncType=multipart/form-dataForm? Li Zhang ASP .Net 4 02-27-2009 01:23 AM
<form>...</form> - how to supress blank space after </form> in IE? rob c Javascript 4 12-30-2005 06:10 PM
javascript form validation - form action to another asp page iam247@gmail.com ASP General 7 08-20-2005 10:06 PM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven Javascript 3 05-13-2004 12:15 AM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven ASP General 3 05-13-2004 12:15 AM



Advertisments