这两天在帮一个初创公司做一个公司的展示页面,其中需要设计一个人员的招聘信息表单。由于jquery moblie这货在表单提交的时候默认使用了ajax,所以在php后台每次都只能接收到多选表单选择的最后一项数据。所以说解决方法是什么呢?当然是禁止ajax啊,可以在from标签中添加data-ajax=”false” 标签即可。form name=myform[] method=post action=submit.phpdata-ajax=false>
特别注意一下: optionvalue=entrepreneurship>entrepreneurshipoption> optionvalue=teamwork>teamworkoption> optionvalue=leadership>leadershipoption> optionvalue=public speaking>public speakingoption> optionvalue=career mentoring>career mentoringoption>
在php中,多选表单的提交中,需要将name标签加上[],加上[]将以array的形式读取数据,这种语法是php所独有的。读取数据的时候,可以通过implode(“,” , $_post[‘var’])来获取集合起来的数据。').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了关于jquery moblie多选表单提交时php接收的处理方法,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
