Forum Moderators: open
//4B
ok, with this form the 'vAmount' is the same as "total2" (or 1), right? Now, I guess item_name can be anything unigue. Does anything have to be set up on paypal that references this (or any
other value besides email)?
<line breaks added to stop side scrolling>
<script LANGUAGE="JavaScript">
function PayPal(vQty, vItem, vAmount){
popup = window.open('h**ps://www.paypal.com/cart/add='+vQty+'&business=email@deleted.com
&item_name='+vItem+'&amount='+vAmount+'&return=deleted.com&cancel_return=deleted.com',
'cartwin','width=600,height=400,scrollbars,location,resizable,status')
}
</script>
//5B
ok, here is an item from that page...the thing is, it doesnt have options that change values... what I need to know is how to change this so that is takes the value of "total2" and puts it into the
<!--line breaks added-->
//'h**ps://www.paypal.com/cart/add='+vQty+'&business=email@deleted.com&
item_name='+vItem+'&amount='+vAmount+'&return=deleted.com&cancel_return=deleted.com',
'cartwin','width=600,height=400,scrollbars,location,resizable,status'
<form name="frm54">
<div align="center"><center>
<table border="0" cellSpacing="0" cellpadding="0" width="90%">
<tr>
<td vAlign="top"><center>
<img
src="redcdrw.jpg" width="320" height="320"></center></td>
</tr>
<tr>
<td vAlign="top" width="100%"><strong><font face="Arial, Helvetica" size="2"
color="#0080C0">(CD-104-218) Red CDRW</font><font face="Arial, Helvetica" size="2" color="#2599BA"><br>
</font></strong><font face="Arial, Helvetica" size="2">
<br>
</font><br>
<font face="Arial, Helvetica" size="2" color="#000000"><b></b><b>Sales Price:</font>
<font color="#FF0000"><font face="Arial, Helvetica" size="2">$
60.00</font></font></b></td>
</tr>
<tr>
<td vAlign="top"><font face="Arial" size="2"><strong>Qty:</strong> 1
<script LANGUAGE='JavaScript'>
<!--
var vTotal54 = 60.00
function Price54(frm54){vTotal54 = 60.00}
//-->
</script>
</font><font face="Arial, Helvetica" size="-1">
<input type="hidden"
name="B3" value=" Add "
onclick="parent.order ('(CD-104-218) Red CDRW',
60.00,
1.00,
document.frm54.
quantity[document.frm54.quantity.selectedIndex].value,
'G0')"></font>
[red][1]<!--line breaks added-->[/1][/red]
<a href="#" onclick="PayPal(1,'(CD-104-218) Red CDRW','60.00')"><img src="addpaypal.gif" border="0" width="69" height="24" align="absmiddle"></a> <a href="#" onclick="window.open('https://www.paypal.com/cart/display=1&
business=email@deleted.com','cartwin','width=600,height=400,scrollbars,location,
resizable,status');"><img src="viewpaypal.gif" border="0" width="69" height="24" align="absmiddle"></a></td>
</tr>
</table>
</center></div>
</form>
[edited by: tedster at 7:14 pm (utc) on April 16, 2003]
I appreciate that you probably already have a HUGE headache from plowing through all this script after only 2 weeks acquaintance with JS. But you do suspect that you see what the change should be.
Can you set up a test environment, try out your idea and see how it works? Kick the tires on your new code pretty hard.
See, if I just say yes or no to your question, I could easily have missed some detail. So you'll need to test anyway.
You can't trust me on a code-specific question like this, which depends very much on the original code writer's way of doing things. And I'm very hesitant to give you either a yes or a no in any case, because there's a whole mess of work involved in untangling this thing.
Hope you understand.
<form target="paypal" action="https://www.paypal.com/cgibin/webscr" method="post" class="xgear" style="FONT-SIZE: 8pt" name="calculate">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="deleted@name.com">
<input type="hidden" name="item_name" value="Custom AMD System"
<input type="hidden" name="item_number" value="420420">
<input type="hidden" name="amount" value="99999.99">
<input type="hidden" name="tax" value="0.00">
<input style="COLOR: #0000ff; FONT-FAMILY: Arial" readOnly size="10" value="$499.00" name="total2">
function get_total(){
//edit here for starting price
var tmp = 0 * 1;//do not edit
var type = "cas,cpu";
var type_array = type.split(",");
for(loop = 0; loop < type_array.length; loop++){
var name = eval('document.calculate.' + type_array[loop] + '.value.split(",")');
name[0] = name[0] * 1;
tmp = tmp + name[0];
}
document.calculate.total1.value = "(+" + showpos(tmp) + ")";
document.calculate.total2.value = "$" + showpos(tmp);
}
<input type="hidden" name="amount" value="99999.99">
document.calculate.amount.value = document.calculate.total2.value
document.calculate.total2.value = "$" + showpos(tmp);
<input type="hidden" name="amount" value="499">
<form action="mailto:me@me.com" method="post" enctype="text/plain">
<form target="paypal" action="https://www.paypal.com/cgibin/webscr" method="post" class="xgear" style="FONT-SIZE: 8pt" name="calculate">
<input type="hidden" name="cmd" value="_cart">
.....blahlbahlbah.....
</form>
</form>
<form target="paypal" action="https://www.paypal.com/cgibin/webscr" method="post" class="xgear" style="FONT-SIZE: 8pt" name="calculate">
<input type="hidden" name="cmd" value="_cart" action="mailto:me@me.com" method="post" enctype="text/plain">
....blahblah....
</form>
Anyway, about your first example, form elements cannot be nested, so that's out.
Also, just using mailto: does not give very useful results, but instead gives you raw form data. If you go that route, you would probably want to use a second attribute to give you a more readable formatting - something like action="mailto:me@me.com" enctype="text/plain". And even then, you're depending on the client machine having a properly configured email client for the form's action to execute. Not a good idea.
There are loads of standard CGI scripts that turn form data into an email, such as formmail and aspmail. But your overriding issue here is that you want to take two actions with one form.
You're probably going to need some form of server-side CGI scripting - the form itself has an action that submits to your server. Then your CGI script on the server needs to take two actions with the form data.
I'd suggest asking server side questions over in the CGI Scripting Forum [webmasterworld.com] for the best input.