Can be submitted to different pages according to different buttons
There is a form that submits some data, and I have two ways of dealing with it, but the two approaches are on two different pages. Can I press the different D button to submit to different pages?
Thank you!
------Solution--------------------
Use JS to submit
------Solution--------------------
------Solution--------------------
Use JS to control the action of the form
------Solution--------------------
------Solution--------------------
Although the use of JS can be easily done, but it should be noted that:
1. If the user disables the script feature of the browser
2. If a control named action is placed in the form
Then you're in for a laugh.
It's a good idea to load different handlers in PHP by judging the value of the Submit button (which needs to be named for the Submit button).
------Solution--------------------
Reference:
Although the use of JS can be easily done, but it should be noted that:
1. If the user disables the script feature of the browser
2. If a control named action is placed in the form
Then you're in for a laugh.
It's a good idea to load different handlers in PHP by judging the value of the Submit button (which needs to be named for the Submit button).
First, the browser to disable JS has not seen it in years.
Second, give the form an ID, and then JS directly manipulate the action of this ID.
Third, if the different pages submitted are different languages?
The right thing to do is to give the form an ID and then document.getElementById get the object, then add the onclick event to the different submit to change the address of the action, before committing.
------Solution--------------------
#7楼不明白别人说的就先百度或者google一下吧. #6楼的不错哈 ~ ~
------Solution--------------------
The method of the 6 floor study
------Solution--------------------
The general JS can be achieved.
------Solution--------------------
You first JS get those values
Then get submit a different page ...
------Solution--------------------
I think it's better to double-insurance.
Use JS, also use PHP to judge
However, after all, now the user to disable JS basically no