Can be submitted to different pages according to different knobs

Source: Internet
Author: User
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
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.