ChrisCarlson Posted July 27, 2015 Report Share Posted July 27, 2015 Hello, I have 10 checkbox fields and 1 dropdown field. I need to restrict user from submitting form if any of the 10 checkbox fields are checked and if the dropdown value equals No. Ideally I would like to inform the user via message and disable submit button until condition is corrected. Quote Link to comment Share on other sites More sharing options...
Aurora Posted July 28, 2015 Report Share Posted July 28, 2015 Hello ccarls3, Here is a script which might help you. For my app I used ten CheckBox Fields and one Dropdown Field with "Yes" and "No" values. On the Configure Fields step of your Submission Form add the Header&Footer element. Select the Header element , click on the "Source" button and insert the following script there : <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x1 = document.getElementById("InsertRecordCheckBox1").checked; var x2 = document.getElementById("InsertRecordCheckBox2").checked; var x3 = document.getElementById("InsertRecordCheckBox3").checked; var x4 = document.getElementById("InsertRecordCheckBox4").checked; var x5 = document.getElementById("InsertRecordCheckBox5").checked; var x6 = document.getElementById("InsertRecordCheckBox6").checked; var x7 = document.getElementById("InsertRecordCheckBox7").checked; var x8 = document.getElementById("InsertRecordCheckBox8").checked; var x9 = document.getElementById("InsertRecordCheckBox9").checked; var x10 = document.getElementById("InsertRecordCheckBox10").checked; var x11 = document.getElementById("InsertRecordDropdown").value; if (x11=='No') { if (x1 || x2 || x3 || x4 || x5 || x6 || x7 || x8|| x9 || x10) { /* "MESSAGE" is the text for displaying if you want to disable Submit Button . */ alert("MESSAGE"); return false; } } } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> I hope it helps you ! Regards, Aurora Quote Link to comment Share on other sites More sharing options...
ChrisCarlson Posted July 28, 2015 Author Report Share Posted July 28, 2015 Thank you, this works great! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.