# (remote\_)for\_form placement, most bizar error seen so far

**URL:** <https://www.ruby-forum.com/t/remote-for-form-placement-most-bizar-error-seen-so-far/118407>\
**Category:** Rails\
**Created:** [October 26, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/remote-for-form-placement-most-bizar-error-seen-so-far/118407 "2007-10-26T17:41:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [October 26, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/remote-for-form-placement-most-bizar-error-seen-so-far/118407/1 "2007-10-26T17:41:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [October 26, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/remote-for-form-placement-most-bizar-error-seen-so-far/118407/2 "2007-10-26T18:42:30Z")

</div>

The P element cannot contain block-level elements like FORM [1](http://htmlhelp.com/reference/html40/block/p.html).  
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.

---

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [October 27, 2007, 8:45pm UTC](https://www.ruby-forum.com/t/remote-for-form-placement-most-bizar-error-seen-so-far/118407/3 "2007-10-27T20:45:28Z")

</div>

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

removed\_email\_address@domain.invalid 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](http://www.nabble.com/%28remote_%29for_form-placement%2C-most-bizar-error-seen-so-far-tf4698078.html#a13446229)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).
