Wednesday 29 August 2018

Radio Button as mandatory field

How to make the radio button group as required.

By default, LC Designer doesn't validate the NULL value of the Radio Button Group as Required Field. We need to use JavaScript to implement the logic.
In my example I used a button to first validate the Radio Button Group and if it is not NULL then it sends an email.

Radio Button Required
Snippet:

if(RadioButtonList.yes.rawValue == null && RadioButtonList.no.rawValue == null)
{
app.alert("Please select the option");
}

else
{
var eid = "test@test.com";
var sub = "test subject";
var bdy = "Sample Body";
event.target.submitForm({cURL:"mailto:" + eid + "?subject=" + sub + "&body=" + bdy ,cSubmitAs:"PDF",cCharset:"utf-8"});
}



Source: https://www.dropbox.com/s/912u03ku8au3fcx/RadioButtonRequired.pdf?dl=0

No comments:

Post a Comment