[development] form_set_error and updating form values

Athanasios Velios a.velios at gmail.com
Mon Feb 20 08:21:42 UTC 2012


Hello,

I am trying to alter a form (uc_cart_view_form) with various input 
fields (Qty for products). In template.php I am adding some extra logic 
which applies across a selection of these fields. Once the logic is 
checked I need to display an error message. I am using form_set_error to 
show the message. The problem is that the user then updates the input 
values and updates the form, but the new figures are not taken into 
account. They are shown in the form, but not used in my template.php 
extra logic.

drupal_set_message allows the new values to work but the message appears 
twice and it does not, obviously, link to specific fields in the form 
which are problematic.

Setting form_state rebuild to true before form_set_error does not have 
an effect.

Any ideas of what needs to be done for these values to be taken into 
account with form_set_error?

Thanks

Thanasis


More information about the development mailing list