Jump to content

Make One Of The Checkboxes Required


Recommended Posts

Please try the following code in the footer of that DataPage:

<script>
function chk_fields(){
var chk1 = document.getElementById("InsertRecordFieldName1");
var chk2 = document.getElementById("InsertRecordFieldName2");
var chk3 = document.getElementById("InsertRecordFieldName3");
var chk4 = document.getElementById("InsertRecordFieldName4");
var chk5 = document.getElementById("InsertRecordFieldName5");
var chk6 = document.getElementById("InsertRecordFieldName6");

if ( chk1.checked == false && chk2.checked == false && chk3.checked == false && chk4.checked == false && chk5.checked == false && chk6.checked == false) {
alert('check one checkbox');
return false;
}

}
document.getElementById('caspioform').onsubmit=chk_fields;
</script>

Remember to replace the InsertRecordFieldNames. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...