tags:

views:

27

answers:

1

Hi, i have a form with 2 buttons let say A & B.

The required fields are depending on the button pressed.

Im using actually a DataBinder allowing me to specify requiredFields but for all actions. How can i customize the required fields that will be depending on the button pressed ?

Thanks in advance

+1  A: 

If you use <input type="submit" name="button1" value="Click me!" /> you can check for that button1 value in your form and then use different validation rules within your validator. You just have to extend your binding model according to these button names and to give your two buttons different names. Note that this doesn't work with <button type="submit"> in most IE versions and therefor input[type=submit] is the better choice here :-)

Horst Gutmann