Search Support
-
Cindy ChastangJuly 13, 2016 at 12:13 pm #2313
I have a checkbox control on a client side human service. I have created a function in a customHTML to do a validation to ensure the end user checks the box.
The code looks like this:
var checkBox = page.ui.get(“confirmCheckbox”);
checkBox.setValid(checkBox.isChecked() == true,”Please confirm that all activities have been completed accurately” );
if (checkBox.isValid() == false) { console.log(“checkbox error”);}When I run it without checking the box I can see isChecked = false but isValid = true (expected to see isValid = false )
When I check the box I see isChecked = true and isValid = true (as expected)
It looks like setValid does not work with a checkbox. I just wanted to confirm if this is true – or if there is something incorrect in my code.
SPARK SupportJuly 14, 2016 at 8:36 am #2315Hi Cindy,
I have replicated your code on one of our Test Servers, and everything in your code is correct. However, there appears to be a bug in the .setValid() method of the CheckBox control. The issue has been logged and will be fixed in an upcoming version. Thank you for reporting this to us.
Regards,
Stephen P.
SPARK SupportJuly 14, 2016 at 3:29 pm #2318Hi Cindy,
As a work around, you might try using a Custom HTML Control to hold a validation function, and call this from the On Click event of the Submit button on the page. If the Checkbox is checked, then return true, otherwise return nothing and display an Output Text Control message.
Regards,
Stephen P.
Cindy ChastangJuly 15, 2016 at 5:57 am #2321Thank you Stephen – good to know it will get fixed in a future release.
We opted to add text to the Modal Alert that appears. We check a number of fields in a validation function in the Custom HTML then show a Modal with some instructions if any of them fail.
Melissa MasseyMay 23, 2017 at 10:33 am #4340Is this still a known issue? I am on version 4.5.0.1 EE.
SPARK SupportMay 30, 2017 at 1:49 pm #4351Hi Melissa,
After discussing this issue further with the Development Team, the decision was made to remove the isValid() and setValid() methods from the Radio Button and Checkbox controls. The Checkbox isChecked() and Radio Button isSelected() methods allow the user to determine whether the control has been selected/checked by the user.
http://support.salientprocess.com/docs/enterprise/RadioButton.html
http://support.salientprocess.com/docs/enterprise/Checkbox.html
However, the Checkbox Group and Radio Button Group controls do support the isValid() and setValid() methods.
Regards,
Stephen P.
Melissa MasseyMay 31, 2017 at 7:16 am #4360I was able to use the isValid() in an event and it did the check and added the error text but the error text would not clear after it was valid. Anyone else come across this issue?
-
|
You must be logged in to reply to this topic.