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 -- Posted via http://www.ruby-forum.com/.
Any help? -DP -- Posted via http://www.ruby-forum.com/.
2009/7/2 Dhaval Phansalkar <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > 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. >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
Maybe Matching Threads
- extract and assign xml values to variable
- Ajax page.replace_html model validation render partial errors
- link_to_remote > in :action , interrupt ajax to render a new page outside the :update div ?
- NOOB Ajax question: handling form input
- AJAX and select form help