function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tomasz WoźniakTomasz Woźniak 

Skipping validation after clicking REMOVE button

I have a wrapper class with checkboxes, and a pageblock table with input fields. Some fields are mandatory to fill in to save them, but I also have a Remove button and I'd like to skip validation of the fields, as I don't want to populate the form just to delete them. Do you have any ideas how to do that? Immediate=true doesn't work, because it doesn't send the value of the checkbox to the controller.
bob_buzzardbob_buzzard
A couple of ways I can think of, but nothing simple unfortunately:
  • change the way that you handle required fields so that the checks are carried out server side. 
  • use JavaScript to figure out which checkboxes are selected and then execute an actionfunction inside an actionregion with that information - this will only send back the information in the actionregion thus skipping the validation rules.