About jquery Moblie How to handle PHP when a multiple-select form is submitted

Source: Internet
Author: User

These two days are helping a start-up company to make a company presentation page, which needs to design a recruitment information form for a person.

Since the jquery Moblie is used by default Ajax when the form is submitted, only the last item of the multi-select form selection can be received in the PHP background each time.

So, what is the solution? No Ajax, of course. You can add the data-ajax= "false" label to the From tab.

<form name="myForm[]" method="post" action="submit.php"data-ajax="false">

Pay special attention to:

"area[]" id="area" multiple="multiple" data-native-menu="false">    <optionvalue="Entrepreneurship">Entrepreneurship
   
    option>    <optionvalue="Teamwork">Teamwork
   
    option>    <optionvalue="Leadership">Leadership
   
    option>    <optionvalue="Public speaking">Public speaking
   
    option>    <optionvalue="Career mentoring">Career mentoring
   
    option>

In PHP, multiple-selection forms are submitted with the name tag plus [], plus [] reading the data as an array, which is unique to PHP.

When reading data, the aggregated data can be obtained by implode (",", $_post[' var ').

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the jquery moblie multi-Select form submission when the PHP processing method, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • 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.