On Tue, 2010-03-16 at 20:44 -0700, ct9a wrote:
> hi, guys,
> 
>   I have an app which has two forms on the page.
> 
> Both forms are based on a "search" model.
> 1) Search by keyword only (hence, only 1 element being "keyword")
> 2) Search by a few different attributes (including keyword).
> Attributes are such as price, brand and make.
> 
> When constructing a search form, "form_for" will be used. Here's an
> extract from one of them:
> -------------------- Extract start
> -------------------------------------------------------------------------------------
> <% form_for :search, :url => search_path, :html => {:method => "get"}
> do |f| %>
>  <div id="category_div">
>     <%=  render :partial => 'search/categories' %>
>   </div>
>   <p>
>   <%= f.label :title_like, "Brand" %>
>   <%= f.text_field :brand_like %>
>   </p>
> 
>    ...
>   <p>
>   <%= f.label :title_like, "Keyword" %>
>   <%= f.text_field :title_like %>
>   </p>
>   <p>
>   <%= f.submit 'Search' %>
>   </p>
> <% end %>
> -------------------- Extract end
> -------------------------------------------------------------------------------------
> 
> 
> Now, when the page loads, there are two search forms and both of them
> will have submit buttons with identical names being "search_submit".
> 
> This will obviously cause a failure in the w3c html validator due to
> the identical elements appearing more than once in a page.
> 
> 1) Is there any way we can specify the name of a given submit button?
> 2) Is there an alternative such that I can still maintain two search
> forms in the same page?
> 
----
f.submit 'Search Categories'

f.submit 'Search Something Else'

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en.

Reply via email to