473,587 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript -> form value

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

the javascript variable is:

<SCRIPT LANGUAGE='JavaS cript'>RF2N('To tal');</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
Jul 20 '05 #1
3 18200
hi************@ aol.com (HikksNotAtHome ) wrote in
news:20******** *************** ****@mb-m27.aol.com:
<script type="text/javascript">
document.formNa me.AMT.value = RF2N('Total');
</script>


Thanks for your reply, for some reason it doesn't work for me.
The code is now:

<p><!-- The Way2Pay Button HTML begint hier -->
<form action="https://merchant.way2pa y.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="Bestelli ng">
<input type="hidden" name="TID" value="orderID" >
<SCRIPT LANGUAGE='JavaS cript'>document .form1.AMT.valu e=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="IMAGEFIEL D"
src="https://www.way2pay.nl/pix/voorstel1/betaalnu_klein2 _nieuw.gif"
alt="Betaal met
Way2Pay">
</form>
<!-- The Way2Pay Button HTML eindigt hier --> </p>

The output at the paysite
(https://merchant.way2pay.nl/merchant/payments-w2p.asp) is 0,0 for the
amount.
When i replace the line LANGUAGE='JavaS cript'>
document.form1. AMT.value=RF2N( 'Total');
</script>
with the line <input type="hidden" name="AMT" value="999,99">
the output at the paysite for amount is correctly set at 999,99

The line <SCRIPT LANGUAGE='JavaS cript'>RF2N('To tal');</script>
print the correct amount on screen.

what is it what i'm doing wring here?

Thanks,
Otto

Jul 20 '05 #2
thanks for all the help, but i'm totally lost.

The line <SCRIPT LANGUAGE='JavaS cript'>RF2N('To tal');</script>
print the correct amount on screen. I.m.o. this RF2N('Total')va riable
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='JavaS cript'>document .form1.AMT.valu e=RF2N
('Total');</script> in the form seems to fail to do this tric.

any ideas?
Thanks,
otto

shop script:

+ ' VALUE=' + parseInt(errel) + ' SIZE=2 onChange="c_Eas yShopMaker_c.cC
['+Glo+']=parseInt(docum ent.ffff.copies '+tpq+'.value); rl9
(true,false,fal se)">'+ '</td>');errel = errel - 0;}else if (het == 'price')
{errel = c_EasyShopMaker _c.cP[Glo];document.write ('<td width=10%
bgcolor='+csb+' class="esm_co_t d"><font face="arial" size=2 color='+csw+'
class="esm_co_f ont">'); document.write( qw2(qw1(errel, 2)));if
(c_EasyShopMake r_c.cX1[Glo]=='1') { document.write( '&sup1;'); } else if
(c_EasyShopMake r_c.cX1[Glo]=='2') { document.write( '&sup2;'); }else if
(c_EasyShopMake r_c.cX1[Glo]=='3') { document.write( '&sup3;'); } else {
document.write( '&deg;'); } document.write( '<INPUT TYPE=hidden
name=' + het + tpq + ' value=' + errel + '></font></td>'); errel =
errel - 0; } else if (het == 'productname') { errel =
c_EasyShopMaker _c.cN[Glo]; document.write ('<td width=70% colspan=6
bgcolor='+csb+' class="esm_co_t d"><font face="arial" size=2 color='+csw+'
class="esm_co_f ont">' + unescape(errel)
+ '<INPUT TYPE=hidden name=' + het + tpq +' value='+errel+' >'
+'</font></td>'); } return errel;};functio n rl9(rl10, yy9, yz8)
{c_EasyShopMake r_c.getT();c_Ea syShopMaker_c.F 2[1]=stp0;c_EasySho pMaker_c.F2
[11]=c_EasyShopMake r_c.cTW;c_EasyS hopMaker_c.F2[12]=tw;c_EasyShopM aker_c.F2
[21]=c_EasyShopMake r_c.cCOUN;c_Eas yShopMaker_c.F2[24]
=document.ffff. fffff.selectedI ndex;c_EasyShop Maker_c.F2[25]
=document.ffff. fffff.options
[document.ffff.f ffff.selectedIn dex].value;c_EasySh opMaker_c.F2[26]
=c_EasyShopMake r_c.cPo[document.ffff.f ffff.selectedIn dex]; var huiop=0;
var all_rights_rese rved = 0; var de=""; var easypage3=0; var
today = new Date(); var expires = 0; c_EasyShopMaker _c.cTp0=tp0;
f(true); if (rl10==true){se lf.location.hre f=("kassa.htm") };}var frm2snd =
new Object();functi on f(rl) {if (!easyshopmaker ==false) {;frm2snd='';va r
f2sse=0;for(var x=0, y=10; x<y; x++) {if (document.forms[x]) {;xName =
document.forms[x].name;if (xName.indexOf( 'ffff') == -1) {for (var i=
0,j=document.fo rms[x].elements.lengt h; i<j; i++) {;if (document.forms
[x].elements[i].type.indexOf(' radio') > -1 || document.forms[x].elements
[i].type.indexOf(' checkbox') > -1) {if (rl==true) {c_EasyShopMake r_c.F1[i]
=document.forms[x].elements[i].checked;}else {document.forms[x].elements
[i].checked = c_EasyShopMaker _c.F1[i];c_EasyShopMake r_c.F1n[i]
=document.forms[x].elements[i].name;}}else if (document.forms[x].elements
[i].type.indexOf(' reset') > -1 || document.forms[x].elements
[i].type.indexOf(' submit') > -1) {} else {
if (rl==true) {
c_EasyShopMaker _c.F1[i]=document.forms[x].elements[i].value;
c_EasyShopMaker _c.F1n[i]=document.forms[x].elements[i].name;
if (document.forms[x].elements[i].name.indexOf(' ESM_pro') > -1 && f2sse==0)
{frm2snd = document.forms[x];f2sse=i;} }
else { if (document.forms[x].elements[i].value=='')
{ document.forms[x].elements
[i].value=c_EasySh opMaker_c.F1[i]; };
}; }; }; }; };};if (rl==true &&
frm2snd.length > 0) { for (Glo=0;Glo<c_Ea syShopMaker_c.c N.length;Glo++)
{;frm2snd.eleme nts[f2sse+Glo].value = c_EasyShopMaker _c.cN[Glo]+',
aantal='+c_Easy ShopMaker_c.cC[Glo]+', prijs='+c_EasyS hopMaker_c.cP[Glo];}
frm2snd.subtota l.value = RF2N('subtotal' );frm2snd.disco unttype.value = RF2
('discount1');f rm2snd.discount value.value = RF2N
('discount1cost s');frm2snd.che ckout_option1.v alue = RF2
('AddOption1'); frm2snd.checkou t_option2.value = RF2
('AddOption2'); frm2snd.checkou t_options_total .value = RF2
('AddOptionCost s');frm2snd.tot al_weight.value = RF2
('DeliveryWeigh t');frm2snd.del ivery_zone.valu e = RF2
('DeliveryZone' );frm2snd.deliv ery_zone_code.v alue = RF2
('DeliveryZoneC ode');frm2snd.d elivery_zone_co sts.value = RF2N
('DeliveryZoneC osts');frm2snd. payment_method. value = RF2
('PaymentMethod ');frm2snd.paym ent_method_code .value = RF2
('PaymentMethod Code');frm2snd. payment_method_ costs.value = RF2N
('PaymentMethod Costs');frm2snd .freedelivery.v alue = RF2
('FreeDelivery' );frm2snd.total _delivery_costs .value = RF2N
('totaldelivery costs');frm2snd .Tax1subtotal.v alue = RF2N
('tax1subtotal' );frm2snd.Tax1a mount.value = RF2N
('tax1amount'); frm2snd.Tax1des cription.value = RF2
('tax1descripti on');frm2snd.Ta x2subtotal.valu e = RF2N
('tax2subtotal' );frm2snd.Tax2a mount.value = RF2N
('tax2amount'); frm2snd.Tax2des cription.value = RF2
('tax2descripti on');frm2snd.Ta x3subtotal.valu e = RF2N
('tax3subtotal' );frm2snd.Tax3a mount.value = RF2N
('tax3amount'); frm2snd.Tax3des cription.value = RF2
('tax3descripti on');frm2snd.ta xfreeZone.value = RF2
('taxfreezone') ;frm2snd.Taxsum character.value = RF2
('taxsumcharact er');frm2snd.ta x.value = RF2('tax');frm2 snd.taxcosts.va lue =
RF2N('taxcosts' );frm2snd.TOTAL .value = RF2N('total');f rm2snd.OrderID. value
= RF2('orderid'); }}return;}var timer;function zzz() {
Jul 20 '05 #3
> i need to read a variable in a javascript and translate it to a form in
html

the javascript variable is:

<SCRIPT LANGUAGE='JavaS cript'>RF2N('To tal');</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?


I didn't read the code you've posted in the two posts following this one,
but if all you need to do is what you describe above, then the simple
solution would be to replace

<input type="hidden" name="AMT" value="**">

- with -

<SCRIPT LANGUAGE='JavaS cript'>
document.write( '<input type="hidden" name="AMT" value="' + RF2N('Total')
+ '">');
</script>

This will happen as the page loads, so the value inside the tag will be
whatever value RF2N returns at that time. If the value of RF2N depends on
any user interaction after the page loads, then the value will be *wrong*.
In that case you need a completely different approach.

Daniel
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6405
by: rickcheney | last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I had a form where the user entered a value into a text box and when a command button on the form was clicked a Report was opened. The reports record source is a query. The query uses the value from the form text box to restrict the query. Table name = EggsTable one of the...
6
2488
by: David | last post by:
Ok. Can PHP control a form value directly? Eg. like the javascript "document.Form1.text01.value = "Y"". Eg. allow me to put a value into a form text field on page load. Either I missed this in my PHP book or the function does not exist. The only way I have seen is to put code in the value part of the input item, see below. Thanks
3
4484
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get the latest value of the checkbox. Does this sound like a posibility and if so how can I force the server to get the new value from the page? ...
0
2436
by: ab_j | last post by:
I have a user control that contains a dropdown which I want to use as a menu on multiple .aspx pages. Basically, all I am trying to do is pass the selected value of the dropdown in the user control to the main ..aspx page. In an attempt to make it more clear on what I am talking about, here is the order of events in page life cycle (from...
4
16255
by: dschruth | last post by:
Hello. Can anybody solve this problem? I am using a server-side language (PERL) to *try* to POST data to a HTTPS login script that doesn't have a standard "submit" button. The form appears to use javascript to submit the document via the browser's DOM. <form action='loginScript.cgi' method="post" name="loginForm">
1
3900
by: Sergey Zuyev | last post by:
Hello all I have simple edit form. When user saves data that contains restricted characters such as (< , etc.) , regular expression validator will display a warning message. It all works fine, but if users decides to exit the form using Cancel button then error occurs: A potentially dangerous Request.Form value was detected from the client....
3
10502
by: judy.j.miller | last post by:
Does anyone know why i can't access a form element value using dot notation in firefox, when i'm in a function. Works ok in the body. I'm trying to do this: var FarTemp = faren.temp.value; I can get at the value using the array method, the getelements by id method, and the bracket-with-the-element-name in it method. But the dot notation...
5
2495
by: jose1lm | last post by:
What is supposed to happen: A user enters data into one of the FORM input selections. When the user submits the form, the onclick event is supposed to go to a function that will set another FORM value (SearchSel) to some number that will be used on the next page. The javascript function 'setSelx' doesn't work in FireFox but works with the ...
0
1424
by: prodigyjohn | last post by:
I want to get JSP form value to IFRAME. I had created the both of the Form and IFRAME, but I cannot send the value from form to IFRAME. I tried with session but it is not applicable to this I think. help to solve this problem with eg.. Thanks in Advance.....
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.