Forum: Ruby on Rails Specify ID for a form?

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.
9b7647d55df4584d7031130915556040?d=identicon&s=25 Will Briggs (Guest)
on 2006-01-17 18:25
(Received via mailing list)
Hi all,

I have a a really, really dumb Newb question...  I am trying to use
observe_form to use AJAX calls in order to refresh a particular page
fragment using the form data.

I have run into a stumbling block very early on in the process - how can
I
provide an 'id' attribute to the form_remote_tag or start_form_tag
methods?
Specifying something like :id => 'myForm' doesn't appear to add an ID
attribute in the generated HTML.  Any help would be greatly appreciated!

Thanks,
Will
82476266af9d460415d8f1fc16bb54ed?d=identicon&s=25 Jarkko Laine (jarkko)
on 2006-01-17 18:28
(Received via mailing list)
On 17.1.2006, at 18.44, Will Briggs wrote:

> help would be greatly appreciated!
You need to separate the html id => ... part into its own
html_options hash:

   <%= start_form_tag({ :action => "edit", :id => @article }, {:id =>
"article_form", :enctype => "multipart/form-data"}) %>

//jarkko
616226cee3466e91febcd38f75c69194?d=identicon&s=25 Helmut Sedding (Guest)
on 2006-01-18 17:36
(Received via mailing list)
Hi,

use a hidden fields to add additional parameters. these are not
displayed to the user.

     <%= hidden_field_tag "formid", "myForm" %>

regards
Helmut
This topic is locked and can not be replied to.