hi everybody,
i have a webpage contain few button there. one of the button click for post to self page to add data to the table. another button is submit to database then jump next page. But a page only contain a form, how i post to self page and also another page ??
Beside using if (), another method to be done?
Thank you
a form Post to many page
Moderator: General Moderators
- daven
- Forum Contributor
- Posts: 332
- Joined: Tue Dec 17, 2002 1:29 pm
- Location: Gaithersburg, MD
- Contact:
This should do it. Cheers
Code: Select all
<script language="javascript">
function SubmitThis(ButtonName){
switch(ButtonName){
case 'A':
document.myform.action="pageA.php"
document.myform.submit;
break;
case 'B':
document.myform.action="pageB.php"
document.myform.submit;
break;
}
}
</script>
<form name="myform" action="">
<input type="button" name="A" value="Submit To Page A" onclick="SubmitThis(this.name)">
<input type="button" name="B" value="Submit To Page B" onclick="SubmitThis(this.name)">
</form>