javascript -> form

Discussion in 'HTML' started by otto, Jun 30, 2003.

  1. otto

    otto Guest

    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
     
    otto, Jun 30, 2003
    #1
    1. Advertising

  2. otto

    otto Guest

    >
    > <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
     
    otto, Jun 30, 2003
    #2
    1. Advertising

  3. 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
     
    Hywel Jenkins, Jul 1, 2003
    #3
  4. David Dorward, Jul 1, 2003
    #4
  5. 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/2003/5/30/microsoft-announces-ie-is-dead
     
    David Dorward, Jul 1, 2003
    #5
  6. otto

    Steve Pugh Guest

    otto <> 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=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

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

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Jul 1, 2003
    #6
  7. otto

    otto Guest

    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
     
    otto, Jul 1, 2003
    #7
  8. otto

    Steve Pugh Guest

    otto <> 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=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

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

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Jul 1, 2003
    #8
  9. While the city slept, Hywel Jenkins <> 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. . Take the dog out!
    http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
    "They got the mustard out!"
     
    nice.guy.nige, Jul 1, 2003
    #9
  10. otto

    otto Guest

    >
    > 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 !
     
    otto, Jul 1, 2003
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Li Zhang
    Replies:
    4
    Views:
    6,147
    softip
    Feb 27, 2009
  2. Replies:
    7
    Views:
    680
  3. Replies:
    2
    Views:
    266
  4. rob c
    Replies:
    4
    Views:
    369
    McKirahan
    Dec 30, 2005
  5. Replies:
    5
    Views:
    210
Loading...

Share This Page