I want to make use of a form_remote_tag to submit a form asynchronously. Easy done. However, we also want to add an observe_form tag to check for some value changes while the form is being entered. The observe_form tag needs a dom id to work on but I can''t see how to enter an html option for the dom id of the form on the form_remote_tag. Any ideas? Here is the form tag so far... <%=form_remote_tag :loading=>"showProgress()", :complete=>"showForm()",:url=>{:action=>:new, :controller=>"sample_controller"}, :update=>"sampleForm"%>
Use <%=form_remote_tag :loading=>"showProgress()", :complete=>"showForm()",:url=>{:action=>:new, :controller=>"sample_controller"}, :update=>"sampleForm", :html => {:id => ''your-super-cool-id''}%> Last line is where it''s different Hope this helps! Daniel -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Sean Blezard Sent: Sunday, June 11, 2006 10:25 PM To: rails@lists.rubyonrails.org Subject: [Rails] dom id on form_remote_tag I want to make use of a form_remote_tag to submit a form asynchronously. Easy done. However, we also want to add an observe_form tag to check for some value changes while the form is being entered. The observe_form tag needs a dom id to work on but I can''t see how to enter an html option for the dom id of the form on the form_remote_tag. Any ideas? Here is the form tag so far... <%=form_remote_tag :loading=>"showProgress()", :complete=>"showForm()",:url=>{:action=>:new, :controller=>"sample_controller"}, :update=>"sampleForm"%> _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Excellent - that did the trick. Thanks for your help - the whole area of html options is not well-documented on the api page, the fact that it says html_options and not html is misleading for starters. Thanks again Sean On 12/06/06, Daniel Higginbotham <daniel@flyingmachinestudios.com> wrote:> Use > > <%=form_remote_tag :loading=>"showProgress()", > :complete=>"showForm()",:url=>{:action=>:new, > :controller=>"sample_controller"}, :update=>"sampleForm", > :html => {:id => ''your-super-cool-id''}%> > > Last line is where it''s different > > Hope this helps! > Daniel > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Sean Blezard > Sent: Sunday, June 11, 2006 10:25 PM > To: rails@lists.rubyonrails.org > Subject: [Rails] dom id on form_remote_tag > > I want to make use of a form_remote_tag to submit a form > asynchronously. Easy done. However, we also want to add an > observe_form tag to check for some value changes while the form is > being entered. > > The observe_form tag needs a dom id to work on but I can''t see how to > enter an html option for the dom id of the form on the > form_remote_tag. > > Any ideas? > > Here is the form tag so far... > > <%=form_remote_tag :loading=>"showProgress()", > :complete=>"showForm()",:url=>{:action=>:new, > :controller=>"sample_controller"}, :update=>"sampleForm"%> > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >