Home > Backend Development > PHP Tutorial > About the processing method of PHP receiving when JQuery Moblie multi-select form is submitted

About the processing method of PHP receiving when JQuery Moblie multi-select form is submitted

WBOY
Release: 2016-07-29 09:07:10
Original
853 people have browsed it

In the past two days, I have been helping a start-up company to create a company display page, which requires the design of a personnel recruitment information form.
Since JQuery Moblie uses Ajax by default when submitting forms, only the last item of data selected in the multi-select form can be received in the PHP background each time.
So what is the solution? Of course, Ajax is prohibited. You can add the data-ajax="false" tag to the from tag.
<code><span><</span>form name<span>=</span><span>"myForm[]"</span> method<span>=</span><span>"post"</span> action<span>=</span><span>"submit.php"</span><span>data</span><span>-ajax</span><span>=</span><span>"false"</span><span>></span></code>
Copy after login

Pay special attention to:

<code><select name=<span>"area[]"</span> id=<span>"area"</span> multiple=<span>"multiple"</span> data-native-menu=<span>"false"</span>>
    <<span>option</span><span>value</span>=<span>"Entrepreneurship"</span>>Entrepreneurship</<span>option</span>>
    <<span>option</span><span>value</span>=<span>"Teamwork"</span>>Teamwork</<span>option</span>>
    <<span>option</span><span>value</span>=<span>"Leadership"</span>>Leadership</<span>option</span>>
    <<span>option</span><span>value</span>=<span>"Public speaking"</span>>Public speaking</<span>option</span>>
    <<span>option</span><span>value</span>=<span>"Career mentoring"</span>>Career mentoring</<span>option</span>>
</select></code>
Copy after login
In PHP, when submitting a multi-select form, you need to add [] to the name tag. Adding [] will read the data in the form of array. This syntax is unique to PHP some.
When reading data, you can obtain the collected data through implode(“,” , $_POST[‘var’]).
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the processing method of PHP reception when the JQuery Moblie multi-select form is submitted, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template