the way i do it is by using the webhelpers as follows (using myghty): from template: <form ..> ... your select options, etc... <span id="txtfld"><% h.text_field("res", value=initial_val) %></span> </form> <% h.observe_form("your_form_with_select", url=hurl(controller=..,action=..), update="txtfld", with='value') %>
and from controller: new_val = request.params.get('val') return Response(h.text_field("res", value=new_val)) On Apr 27, 6:15 am, Dan <[EMAIL PROTECTED]> wrote: > Would someone give an example how I could replace a DOM object from the > controller? > > For example, I have an onChange for a <select> that calls a function > within the controller. The controller function is receiving the > this[this.selectedIndex].value (an integer). I can pass the int value > from the <select> onChange into the controller, storing it as c.value. > I want the controller to take c.value and update the 'value' of a text > field on the same page without a refresh. > > All I can figure out is how to replace an entire element, such as, a > <div> or the entire <input> by return render_response('some_template') > > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---