form won't submit when mixing n:form and {input} macros, nette #0c87249e07a

Notice: This thread is very old.

7 years ago

bazo
Member | 625
+
0
-

i had a form

<form n:form="formNewMessage">
  {label context /}
  {input context}
  {label singular /}
  {input singular}
  {label plural /}
  {input plural}
  {input btnSubmit class => "btn btn-primary"}
</form>

i updated nette to #0c87249e07a after a year and the form suddenly stopped working. The error or success callback wouldn't fire.
so after an hour i tried changing it to

{form formNewMessage}
  {label context /}
  {input context}
  {label singular /}
  {input singular}
  {label plural /}
  {input plural}
  {input btnSubmit class => "btn btn-primary"}
{/form}

and it worked!

is this by design or is it a bug? because this worked for quite some time

7 years ago

David Grudl
Nette Core | 7067
+
0
-

I think that n:form was never supported. It really worked?

7 years ago

bazo
Member | 625
+
0
-

well yes. otherwise i wouldn't be so surprised at 2am :D

can an exception be thrown when mixing macros? because it produces exactly the same html in both cases

7 years ago

David Grudl
Nette Core | 7067
+
0
-

Really the same HTML? n:form should produce something invalid like <form action="" method="post"><form>. Now it throws exception.

7 years ago

bazo
Member | 625
+
0
-

here https://gist.github.com/bazo/5990343 you can see both latte templates and generated html. the only difference in html is that <form n:form class=“ajax”> won't render the class attribute.

also the php form definition is there

7 years ago

bazo
Member | 625
+
0
-

and also if i have the following form

<form n:form="formDeleteMessage" class="ajax">
	<a href="#" class="btn" data-dismiss="modal">Close</a>
	<input n:name="btnSubmit" class="btn btn-danger">
	<input n:input="id">
</form>

the class attribute is missing from the output html, but just for the form element