You are viewing limited content. For full access, please sign in.

Question

Question

"Value is required" even though there is a value in the form field

asked on April 24, 2017

I am getting a "Value is required" statement stopping me from Submitting a test run of my new form, even though there is a value.  It is the Province field, the Address field which has been adapted by JavaScript to remove the mentions of US States and Zip Codes.  

There are no other requirements on the field, no restrictions like all numbers etc.  Why won't it acknowledge that there is a value in the field?

1 0

Answer

SELECTED ANSWER
replied on April 24, 2017

Hi Connie,

The validation warning is for the "Country" input in the Address field. While the JS you're using hides that particular input, the required validation is still running on it. Can you hard code the value "Canada" as the country in JS or perhaps just leave it as single white space?

$(document).ready (function () {
  $(".Country").parent().children().val("Canada");
  $(".Country").parent().children().css('display', 'none');
})

or

$(document).ready (function () {
  $(".Country").parent().children().val(" ");
  $(".Country").parent().children().css('display', 'none');
})
2 0
replied on April 24, 2017

That's it!  Don't know why I didn't realize that.  Thank You!

1 0
replied on September 23, 2020

Thank you!  This was a big help to me too!

Christine

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.