The problem I have is that I need to disable struts validation when selecting certain conditions that will leave input boxes disabled and blank.
Leaving these inputs empty causes the validation to fail which is not what I need
The problem I have is that I need to disable struts validation when selecting certain conditions that will leave input boxes disabled and blank.
Leaving these inputs empty causes the validation to fail which is not what I need
Set a property on your form when you trigger these conditions and then check for that in your validator:
if(!form.isSkipValidation()){
// validation goes here
}
If you're triggering these skip validation conditions with javascript, you can set this property with a hidden input field:
<input type="hidden" name="skipValidation" value="false"/>