Forum: Ruby on Rails dom id on form_remote_tag

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sean B. (Guest)
on 2006-06-12 12:27
(Received via mailing list)
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"%>
Daniel H. (Guest)
on 2006-06-12 12:55
(Received via mailing list)
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
Sean B. (Guest)
on 2006-06-12 13:17
(Received via mailing list)
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
This topic is locked and can not be replied to.