简体   繁体   English

javascript表单验证,其中不包括隐藏的下拉菜单

[英]javascript form validation which excludes hidden dropdown

The code for my project is http://jsfiddle.net/CVS2F/2/ . 我项目的代码是http://jsfiddle.net/CVS2F/2/ I also have a submit button which submits the data to mysql, but when i click attending: 'no' there is no value submitted by user as they are not attending dropdowns are hidden but with the code an error pops up anway. 我也有一个提交按钮,它将数据提交给mysql,但是当我单击出席时:'no'没有用户提交的值,因为他们未出席的下拉菜单被隐藏了,但是错误代码突然弹出。 is there a way around this to ignore hidden dropdowns? 有没有办法解决隐藏的下拉菜单?

In the php code add these lines: 在php代码中添加以下行:

if($_REQUEST['yesNo'] == 'yes)
    {
    // form process with list
    }
    else
    {
    // form process without list
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM