我有一个简单的表单,有四个选择字段.如果在任何表单域中选择"是",则需要禁用"提交"按钮并显示隐藏的div.这是我的标记示例:
<form>
I have read the information on the product(s)<select name="field4"> <option value="Yes">Yes</option> <option value="No">No</option> </select>
Do you have any allergies to any ingredients in product(s)?
<select name="field5"><option value="Yes">Yes</option> <option value="No">No</option> </select>
Are you pregnant?
<select name="field6"> <option value="Yes">Yes</option> <option value="No">No</option> </select>
Have you ever used this type of product and had undesirable results?
<select name="field7"> <option value="Yes">Yes</option> <option value="No">No</option> </select>
<input name="cmdSubmit" type="submit" value="Submit" />
</form>
<div style="display:none;">Hidden div only to appear if any of the four dropdowns are …Run Code Online (Sandbox Code Playgroud)