# Strange problem! Form closing tag

**URL:** <https://www.ruby-forum.com/t/strange-problem-form-closing-tag/79135>\
**Category:** Rails\
**Created:** [December 12, 2006, 1:31pm UTC](https://www.ruby-forum.com/t/strange-problem-form-closing-tag/79135 "2006-12-12T13:31:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [December 12, 2006, 1:31pm UTC](https://www.ruby-forum.com/t/strange-problem-form-closing-tag/79135/1 "2006-12-12T13:31:56Z")

</div>

I have a form tag originaly generated using form\_remote\_tag. After a  
lot of bewildered testing to see why its values arent being passed on,  
I realised when looking at the html output that the form has a closing  
tag on the end (before the form fields).

So I thought maybe its a rails bug, and copied and pasted the generated  
version back into my rhtml file, commenting out the original helper  
call. Still the same. Tried reordering things in the page. No joy. I  
ran a test on another form in the page to check I hadnt lost the plot,  
and that worked fine.

Any help much appreciated!

Here is my rhtml  
code:\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

 \<%#= form\_remote\_tag(:update =\> "invoice\_list\_tbody", # :before =\> "Element.show('spinner')", # :success =\> "Element.hide('spinner')",

```
  # :url => { :action => :filter_render })
%>
		<tr>
			<td>Date</td>
			<td>
			    <input type="hidden" id="hiddenval" name="hiddenval"

```

value=“test”/\>  
  
All  
Issued  
Due  
Received

From  
  
…  
  
  
  
  
  
To  
…  
\<%= submit\_tag “Show date range” %\>  
  

* * *

and the generated  
code:\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

```
<form action="/invoice/filter_render" method="post"

```

onsubmit=“Element.show(‘spinner’); new  
Ajax.Updater(‘invoice\_list\_tbody’, ‘/invoice/filter\_render’,  
{asynchronous:true, evalScripts:true,  
onSuccess:function(request){Element.hide(‘spinner’)},  
parameters:Form.serialize(this)}); return false;”\>

```
<tr>
			<td>Date</td>
			<td>

			    <input id="hiddenval" name="hiddenval" value="test"

```

type=“hidden”\>  
  
All  
Issued  
Due  
Received

```
			<td>From</td>
			<td>
                <input name="f_date_a" id="f_date_a"

```

type=“text”\>…

  
  

```
			<td>To</td>
			<td><input name="f_date_b" id="f_date_b" type="text"><button

```

type=“reset” id=“f\_trigger\_b”\>…

```
		<tr>
			<td></td>
			<td>
```

---

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [December 12, 2006, 2:50pm UTC](https://www.ruby-forum.com/t/strange-problem-form-closing-tag/79135/2 "2006-12-12T14:50:07Z")

</div>

You’ve commented out the closing parenthesis on the  
\<%=form\_remote\_tag(…

I had the same problem a couple weeks ago, and it took me forever to  
figure out what went wrong.

---

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [December 12, 2006, 3:54pm UTC](https://www.ruby-forum.com/t/strange-problem-form-closing-tag/79135/3 "2006-12-12T15:54:22Z")

</div>

Thanks, but I dont get it - I’m not even using the rails helper anymore  
(its  
all commented out), and its still putting the closing form tag right  
after  
the opening tag.

---

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [December 12, 2006, 4:36pm UTC](https://www.ruby-forum.com/t/strange-problem-form-closing-tag/79135/4 "2006-12-12T16:36:37Z")

</div>

No problem,

might have to just dissect the whole page a bit more…

Cheers

---

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [December 12, 2006, 4:16pm UTC](https://www.ruby-forum.com/t/strange-problem-form-closing-tag/79135/5 "2006-12-12T16:16:29Z")

</div>

Sorry, obviously I didn’t read carefully enough the first time…

Have you tried creating a temporary view with only that code in it to  
see what happens? I’ve been trying to recreate your problem, but I  
can’t. I’ve tried the generated html with the comments and the original  
code with the helper tag uncommented and the appears in the  
right places both times.
