This site uses cookies to deliver our services and to show you relevant ads and job listings.
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service.
Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.

Join us in building a kind, collaborative learning community via our updated
Code of Conduct.

Or you could just check for the default value, which might be enough for most cases (unless you're working with numbers).
– Matt3o12Apr 18 '15 at 15:50

But what if the value of the "required field" is the default value?
– AnferneeMay 27 '16 at 13:40

if the required field of a number is possible to be 0 and you also need to check if its provided, then use string's instead to allow checking of no input and then convert the string to a number after.
– ZanvenFeb 6 '17 at 23:08