Ajax based form - render action breaks form

hi all,

i’ve 4 select boxes in a form(_form.rhtml), one dependent on the
other. initially, when form is loaded, only 1st box is enabled. after
selecting value in 1st select box, it inserts 2nd, on 2nd’s change, 3rd
gets inserted and on 3rd’s change, 4th gets inserted. this flow works
perfect for me. i’ve used ajax for this flow. this form then is sent to
back end java application thru xml request which then sends xml response
as success or failure.

on success, i redirect control to action=>new again and on failure,
render the same page. while rendering on failure, my 2nd,3rd,4th select
boxes disappears from the form where as other form field stay with their
current inserted values.

what should i do to keep those fields in the form with their current
values? i hope i’ve explained the scenario properly. let me know if not.

-DP

Any help?

-DP

2009/7/2 Dhaval P. [email protected]:

 on success, i redirect control to action=>new again and on failure,
render the same page. while rendering on failure, my 2nd,3rd,4th select
boxes disappears from the form where as other form field stay with their
current inserted values.

 what should i do to keep those fields in the form with their current
values? i hope i’ve explained the scenario properly. let me know if not.

When re-displaying you must pass the selections to the form and
display all select boxes if the values are present. Or something
along those lines.

Colin