(remote_)for_form placement, most bizar error seen so far

Dear list,

I must be going mad. My code:

<%=h user.phone %>

<%=h user.company %>

<% @message = Message.new %> #UGLY, someone has a solution?
<% form_for([@project, @message]) do |f| %>
<%= f.hidden_field(‘recipient_id’, :value => user.id ) %>
<%= f.text_area(‘text’, :size =>“10x4”) %>

<%= submit_tag(‘Verstuur’) %>
<% end %>

So the form is enclosed in a hidden p tag. This works like a charm in
Opera, however in FF the form does show! ‘show source’ shows the
correct HTML but Firebug shows that the p tag closes before the
form. Really really weird.
Does this sound familiar to someone?

With kind regards,
Harm

PS @message can be empty as it is really simple, now fixed with an
ugly hack. Any suggestions?

The P element cannot contain block-level elements like FORM 1.
Firefox tends to be pretty strict about form elements, so I suspect
that’s your problem. It should work if the wrapping element is a DIV
instead.

That must be it. Thank you I didn’t know that(obviously). Thanks for the
link
as well.

[email protected] wrote:

Dear list,
<%= f.text_area(‘text’, :size =>“10x4”) %>

With kind regards,
Harm

PS @message can be empty as it is really simple, now fixed with an
ugly hack. Any suggestions?


View this message in context:
http://www.nabble.com/(remote_)for_form-placement%2C-most-bizar-error-seen-so-far-tf4698078.html#a13446229
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs