Michele Cella wrote: > Steve Bergman wrote: > > I have a form with a textfield that starts out blank. When the user > > completes a singleselectfield the form is submitted by onchange=. The > > validation fails (as I want it too) the error handler gets control and > > sets values['my_text_field'] to a value based on what the user selected > > from the singleselectfield. But the textfield never gets that value. > > (Although it does if I set the same values['my_text_field'] before the > > form is displayed the first time.) > > > > How can I change the text of a field in the error_handler? I thought > > maybe setting a value in cherrypy.request.params might do it, but that > > doesn't work. > > Hi Steve, > > Change the input field value inside cherrypy.request.input_values. >
Anyway I dunno what you're trying to achieve but personally instead of submitting the form I will trigger the load of a new document on the onchange event using a different method that receives as parameter the select value in the select field, then you use this method to redisplay the form with the right value by just passing a value dict at display time. I'm probably on crack anyway. Ciao Michele --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

