473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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='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
Jul 20 '05 #1
3 18166
hi************@aol.com (HikksNotAtHome) wrote in
news:20***************************@mb-m27.aol.com:
<script type="text/javascript">
document.formName.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.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>
<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 --> </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='JavaScript'>
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='JavaScript'>RF2N('Total');</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='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

shop script:

+ ' VALUE=' + parseInt(errel) + ' SIZE=2 onChange="c_EasyShopMaker_c.cC
['+Glo+']=parseInt(document.ffff.copies'+tpq+'.value);rl9
(true,false,false)">'+ '</td>');errel = errel - 0;}else if (het == 'price')
{errel = c_EasyShopMaker_c.cP[Glo];document.write('<td width=10%
bgcolor='+csb+' class="esm_co_td"><font face="arial" size=2 color='+csw+'
class="esm_co_font">'); document.write(qw2(qw1(errel, 2)));if
(c_EasyShopMaker_c.cX1[Glo]=='1') { document.write('&sup1;'); } else if
(c_EasyShopMaker_c.cX1[Glo]=='2') { document.write('&sup2;'); }else if
(c_EasyShopMaker_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_td"><font face="arial" size=2 color='+csw+'
class="esm_co_font">' + unescape(errel)
+ '<INPUT TYPE=hidden name=' + het + tpq +' value='+errel+'>'
+'</font></td>'); } return errel;};function rl9(rl10, yy9, yz8)
{c_EasyShopMaker_c.getT();c_EasyShopMaker_c.F2[1]=stp0;c_EasyShopMaker_c.F2
[11]=c_EasyShopMaker_c.cTW;c_EasyShopMaker_c.F2[12]=tw;c_EasyShopMaker_c.F2
[21]=c_EasyShopMaker_c.cCOUN;c_EasyShopMaker_c.F2[24]
=document.ffff.fffff.selectedIndex;c_EasyShopMaker _c.F2[25]
=document.ffff.fffff.options
[document.ffff.fffff.selectedIndex].value;c_EasyShopMaker_c.F2[26]
=c_EasyShopMaker_c.cPo[document.ffff.fffff.selectedIndex]; var huiop=0;
var all_rights_reserved = 0; var de=""; var easypage3=0; var
today = new Date(); var expires = 0; c_EasyShopMaker_c.cTp0=tp0;
f(true); if (rl10==true){self.location.href=("kassa.htm")};}va r frm2snd =
new Object();function f(rl) {if (!easyshopmaker==false) {;frm2snd='';var
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.forms[x].elements.length; 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_EasyShopMaker_c.F1[i]
=document.forms[x].elements[i].checked;}else {document.forms[x].elements
[i].checked = c_EasyShopMaker_c.F1[i];c_EasyShopMaker_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_EasyShopMaker_c.F1[i]; };
}; }; }; }; };};if (rl==true &&
frm2snd.length > 0) { for (Glo=0;Glo<c_EasyShopMaker_c.cN.length;Glo++)
{;frm2snd.elements[f2sse+Glo].value = c_EasyShopMaker_c.cN[Glo]+',
aantal='+c_EasyShopMaker_c.cC[Glo]+', prijs='+c_EasyShopMaker_c.cP[Glo];}
frm2snd.subtotal.value = RF2N('subtotal');frm2snd.discounttype.value = RF2
('discount1');frm2snd.discountvalue.value = RF2N
('discount1costs');frm2snd.checkout_option1.value = RF2
('AddOption1');frm2snd.checkout_option2.value = RF2
('AddOption2');frm2snd.checkout_options_total.valu e = RF2
('AddOptionCosts');frm2snd.total_weight.value = RF2
('DeliveryWeight');frm2snd.delivery_zone.value = RF2
('DeliveryZone');frm2snd.delivery_zone_code.value = RF2
('DeliveryZoneCode');frm2snd.delivery_zone_costs.v alue = RF2N
('DeliveryZoneCosts');frm2snd.payment_method.value = RF2
('PaymentMethod');frm2snd.payment_method_code.valu e = RF2
('PaymentMethodCode');frm2snd.payment_method_costs .value = RF2N
('PaymentMethodCosts');frm2snd.freedelivery.value = RF2
('FreeDelivery');frm2snd.total_delivery_costs.valu e = RF2N
('totaldeliverycosts');frm2snd.Tax1subtotal.value = RF2N
('tax1subtotal');frm2snd.Tax1amount.value = RF2N
('tax1amount');frm2snd.Tax1description.value = RF2
('tax1description');frm2snd.Tax2subtotal.value = RF2N
('tax2subtotal');frm2snd.Tax2amount.value = RF2N
('tax2amount');frm2snd.Tax2description.value = RF2
('tax2description');frm2snd.Tax3subtotal.value = RF2N
('tax3subtotal');frm2snd.Tax3amount.value = RF2N
('tax3amount');frm2snd.Tax3description.value = RF2
('tax3description');frm2snd.taxfreeZone.value = RF2
('taxfreezone');frm2snd.Taxsumcharacter.value = RF2
('taxsumcharacter');frm2snd.tax.value = RF2('tax');frm2snd.taxcosts.value =
RF2N('taxcosts');frm2snd.TOTAL.value = RF2N('total');frm2snd.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='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?


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='JavaScript'>
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
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...
6
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...
3
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...
0
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...
4
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...
1
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,...
3
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...
5
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...
0
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....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.