I am trying to get JS /Custom Code for Custom Validation for free-form text in Side-by-side Question
In this question, I would like Custom Validation for the blanks to be from the range of 0-24 (given that it is number of hours in a day). Without JS I would have to manually load Custom Validation for each cell like this
Wondering if anyone has gotten around this tedious way and is willing to share their code. Thank you!
Custom Validation Side by Side
Best answer by len57
var q = jQuery("#"+this.questionId);
var ve = q.find(".ValidationError");
q.find(".InputText").on("blur", function(e) {
if(this.value <0 || this.value >= 24) {
ve.html(this.value + " is not within range of 0-24");
ve.show();
this.value = "";
Just changed the values to fit what i need which is the range of values between 0-24. My set up was a carry forward entered text for the first column and the JS didn't work ( not sure why!) until I changed it to piped text with display if "not empty" function. Now it works! Didn't disable the next button but I did force response and do text validation to only be numerical values. Thanks rondev for the inspiration and TomG for the base code to toggle with.
Pasting it here in case other noobs like me also need similar help!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
