<select name="WSType" required validate>
<option value="C">Online Seller</option>
Form validation not working if option value is blank.
var WSType = $$(’#addwholesaler-form select[name=WSType]’).val();
When I print the value, it prints “Select”. That is why required attribute is not working.
Expected value should be blank and form should show validation error.
Select can’t be validated because empty string is still a value. You need to validate it manually then
Thanks for the reply!
In normal HTML if we set value="" then it is treated as invalid input.
Why this behaviour changed in framework7?
I did a manually value check and alert the error but it did not satisfy me.
How will you do this in a better way if it can’t be fixed in framework7? Your suggestions will be really helpful and will appreciate it.
It is not framework7 doing it, this how default validation works in browser