Hi,
I need to set a field (that is normally required) to "not required" if a checkbox gets checked!
How would I achieve this with javascript?
Thanks in advance!
Hi @Newmayer2384 ,
You can inspect the element, get the element's id, and then try the following code as an example.
$(document).ready(function(){
$("#isCheckBox1").on('change', function() {
if ($("#isCheckBox1").is(':checked'))
alert("checked");
else {
alert("unchecked");
}
});
});
Again this is an example. I am not sure what is your full requirement. Please give a try.
Hope it helps.
Hope it helps.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi,
thanks for the answer!
However I am not sure how to implement the logic to set a field not required. I need to set a lookup field (parentcustomerid) not required as soon as a checkbox of (xxx_idontfindmyorg) is checked.
Thanks for the help! Much appreciated.
I hope the following links will answer your questions.
Get-and-set-field-values-using-formcontext-and-javascript-with-dynamics-365
If you are looking for the best developers course to learn how to write JavaScript Microsoft Dynamics 365 training online, I would suggest you check out
Microsoft Dynamics 365 Developers-technical-training-part-2
Thanks
shilpa
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
7 | |
3 | |
2 | |
1 | |
1 |