...

View Full Version : smple submit question



inusrat
10-31-2004, 06:16 PM
Hi,

I have a form.

echo "<form action=creditcardbackend.php name=creditcard method=POST>"

Based on Javascript function if statement
I want to send it to differnt page then "creditcardbackend.php ".... how do I do that...


if (document.creditcard .checkbox_all.checked){
document.submit()??????
}

Thanks

fci
10-31-2004, 06:31 PM
if (document.creditcard .checkbox_all.checked){
document.forms[0].action = 'file.php';
document.forms[0].submit();
}


but.. seeing as how I _think_ changing the action might not be allowed(security reason?).. you could always do it server side anyway.

anyway.. serverside way:


if ($_POST['checkbox_all']) {
include 'otherfile.php';
} else {
///
}

inusrat
11-01-2004, 04:18 PM
thanks a lot



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum