I am working on a team site inside my sharepoint on-premises 2013. now i have the following site column of type choice:-
now i want to make this site column required under certain scenarios, so i decide to force this column to be Required using javascript. now this site column will be rendered as following inside our edit forms:-
<input id="OrderLiveOrder_0e0052d6-9924-4774-b50d-d7ef364d744a_MultiChoiceOption_0" type="checkbox">
so inside my JavaScript which i am referencing inside my Edit form, i tried the following 2 approaches:-
Using prop
$('input[id^="OrderLiveOrder_"]').prop("required", true);
then using attr
$('input[id^="OrderLiveOrder_"]').attr("required", true);
now those will modify the field's markup to be as follow, by adding the required="required" attribute:-
<input id="OrderLiveOrder_0e0052d6-9924-4774-b50d-d7ef364d744a_MultiChoiceOption_0" type="checkbox" required="required">
but this will not prevent the users from submitting the checkbox, if they leave it uncheck.. so can anyone advice how i can force my Choice site column to be conditionally required inside my edit form?? Thanks
