lamagamorgana
Programmer
Hi all,
I'm having some trouble with javascript client-side validation.
I'm using the basic validation rules: required, email, double, and I find out that while required and email work fine both server-side and client-side just by including the validation rule in validator-rules.xml, Double is missing the client-side validation. So i investigate further and find out that the syntax is the same, but even if i don't write any js code in the validator-rules.xml, it works automatically for the rules "required" and "email", and not for "double". I stumbled upon the org/apache/commons/validator/javascript apis and noticed that there are js files called exactly the same as the server-side method used for validation (that is validateRequired.js and validateEmail.js) but actually there is no validateDouble.js... are these things related?
Does Struts look for a js file in that particular library when you use a "standars" validation rule?
iI couldn't find a manual that told that.
So do i have to write a js validation rule for double??
thank you
fra
I'm having some trouble with javascript client-side validation.
I'm using the basic validation rules: required, email, double, and I find out that while required and email work fine both server-side and client-side just by including the validation rule in validator-rules.xml, Double is missing the client-side validation. So i investigate further and find out that the syntax is the same, but even if i don't write any js code in the validator-rules.xml, it works automatically for the rules "required" and "email", and not for "double". I stumbled upon the org/apache/commons/validator/javascript apis and noticed that there are js files called exactly the same as the server-side method used for validation (that is validateRequired.js and validateEmail.js) but actually there is no validateDouble.js... are these things related?
Does Struts look for a js file in that particular library when you use a "standars" validation rule?
iI couldn't find a manual that told that.
So do i have to write a js validation rule for double??
thank you
fra