AnsweredAssumed Answered

IRF - Make text field required when one Radio button is selected

Question asked by CyanX on Oct 15, 2014
Latest reply on Oct 20, 2014 by CyanX



I am creating an approval IRF comprised of 2 Text Fields (Form.Information, Form.Comments), 1 HTML (Form.Approval_Instruction) and 1 Select field (Form.Status). Options for the Select field are "Approved" (Form.Status.Approve) and "Rejected" (Form.Status.Reject). I want the Comments text field to be required only if the "Rejected" radio button is selected (onClick). Is this possible using the PAM built in functions? I know I can use something like ca_pam_isSelectRadio('Form.Status','Form.Status.Reject'), but I'm missing the part that references "Comments" and makes it required. I also tried modifying the validate script used in this  thread how to create new form element function, but could not get the Alert to work. In any case, I would prefer not to have an alert, but to prevent the user from submitting the form if the Comments box is not filled out, after selecting Rejected. Please assist.