Hello everyone,
I have a form where depending on the value of a SingleSelect field,
I need to get back a list of checkboxes from the server using AJAX.
eg. If I select "Linux" on the SingleSelect field, I need to get back
["Ubuntu","Fedora","SuSe"]. The returned value also contains a
default. Using this, I create a list of radiobuttons so that user can
specify which distro he's using. I create the list of radiobuttons
using MochiKit.DOM manually and then enable the default.
This works fine but the problem is if I submit the form as a whole
and there are some fields in the form which don't pass validation. The
fields that had valid values retain their contents. The others get
appropriate error messages. The SingleSelect referred to above retains
"Linux" as the value but the radiobuttons are generated again hence
they lose the previous setting and revert to the defaults which the
server sends back.
This is a pain since users expect their selections to be retained
in the case of an error.
I'm pretty sure this isn't the right way to handle this but I
pushed it out since I was pressed for time. Now that I have some free
time on hands, I'd like to redo it the right way. I'd appreciate any
advice.
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---