Jump to content

Javascript


jay_bo

Recommended Posts

Okay i have a shopping cart which has the ability to add and remove items in the cart, which is done by javascript..as seen below

 

function del(pid){
	if(confirm('Do you really mean to delete this item')){
		document.form1.pid.value=pid;
		document.form1.command.value='delete';
		document.form1.submit();
	}
}
function update_cart(){
	document.form1.command.value='update';
	document.form1.submit();
}

 

It use to work fine when i add

<form name="form1" method="POST">

but i recently changed it to the code below, so that i can link it to paypal.

<form name="form1" action="https://www.sandbox.paypal.com/uk/cgi-bin/webscr" method="POST">

 

Since i add this when i click to update an item it doesn't update, it just submits the form.....Now i know this has something to do with the javascript line....

document.form1.submit();

Is there anyway that i could get it to refresh the page?

Link to comment
https://forums.phpfreaks.com/topic/200047-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.