Mandatory checkbox in HTML in custom widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2025 02:14 AM
HTML-----
<div class="col-md-12">
<div class="col">
<input type="checkbox" ng-model="c.formInput.emailCheck" name="email" id="email" ng-disabled="c.formInput.postCheck"> {{data.messages.email}}
</div>
</div>
<div class="col-md-12">
<div class="col"> <input type="checkbox" ng-model="c.formInput.postCheck" name="post" id="post" ng-disabled="c.formInput.emailCheck"> {{data.messages.post}}
</div>
</div>
---------------------------------
Output:-
I have two checkbox in HTML, want to make it mandatory. Means atleast one of these checkbox must be selected. what to change in html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2025 11:00 PM
below is the custom "submit" button but applying your code is not working.
@Ankur Bawiskar yes, there was requirement from customer that they want separate page for it and when user submit they just want a record for future reference for which we have created custom table to store records. And these records are very confidentials for which they have given access to very few high level people. And they need checkbox only and not radio button so that they can select 1 or both the checkbox. But atleast one should be selected by user.
---
<div class="buttonContainer pull-right">
<span ng-if="c.isLoading" class="text-muted"><i class="fa fa-spinner fa-pulse" aria-hidden="true"></i>
Please wait. your request is being submitted</span>
<button class="btn btn-primary" ng-click="c.getSummary()" ng-disabled="submitDisabled">
{{data.messages.submit}}
</button>
</div>
</form>
</div>
<!--makes the page unaccessible once item is submitted-->
<div class="bg-overlay" ng-if="c.itemSubmitted">
</div>
---
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2025 11:28 PM
share the complete widget code here HTML, Client controller etc
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2025 03:32 AM
can you share emailid , i'll email you
