I have a field that needs to equal 100, I this is the settings:
The problem is that the validation error returns this:
I would like to for the error to be "Value must be equal to 100."
I have a field that needs to equal 100, I this is the settings:
The problem is that the validation error returns this:
I would like to for the error to be "Value must be equal to 100."
There's multiple ways to accomplish this. One way is to plug this code into your form's CSS/JavaScript section:
$(document).on("ready", function() { $("#Field1").on("change", function() { if (parseFloat($(this).val()) != 100) { setTimeout(function() { $("#Field1").siblings(".ws-errorbox").find(".ws-errormessage").text("Value must be equal to 100"); }, 25); } }); });
Where it says "Field1" you need to change it to the ID of your TotPBasicPercent field. You can find that on the right-hand side of the CSS/JavaScript page (the preview pane). For example, if your field's container has an id of "q45", then your field ID is "Field45".
The above code intercepts the error message and changes it to what you want. An alternative would be to display a pop-up message.
$(document).on("ready", function() { $("#Field1").on("change", function() { if (parseFloat($(this).val()) != 100) { $(this).val(""); alert("The total basic life insurance percentage must equal 100."); $(this).focus(); } }); });
I tried the first option, and the error message did not change.
The other option, although possible, still leaves a rather confusing error on the screen for the user after they click past the alert message.
I worked with this some more and I was able to get it to work . Thanks you so much.