[html-formfu] Redirection after an error

hallouina-formfu at yahoo.fr hallouina-formfu at yahoo.fr
Thu May 29 16:52:39 BST 2008


I have a web page splitted into 3 tabs. I have a form on the first tab. On the second tab I display a list of object from a table. I can add object in the second tab with FormFu and I redirect to this second tab after the validation (here :   http://localhost:3000/person/view/1#tab2 ). It works fine.

But after that, If I clic on the first tab my page isn't refresh because it's javascript. So the browser stay on this url : 


And I fill my form in the first tab. If my form isn't full fill, i get this message : "This field is required". But i'm redirect from the prefious url : the second tab. I suppose this is because the default FormFu behavior is to redirect to the previous url in case of error. To avoid this problem I add this line to my controller :

        if ($form->submitted && $form->has_errors) {
                $c->response->redirect($c->uri_for("/person/view/$id_person#tab1")); $c->detach;

And it works : I stay on the first tab. But I get no more the error message : "This field is required".

How could I do to solve my problem please ? To say to FormFu to redirect to the first tab in case of error and get my error message ?

Thanks for your attention.


Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail 

More information about the HTML-FormFu mailing list