1

I am building a registration form using parsley and I found that this code works:

<form  data-validate="parsley" id="registration_form" action="register.php" method="POST">

  <label>Full name:</label>
  <input type="text" id="full_name" name="full_name" placeholder="FirstName LastName" data-required="true" data-trigger="keyup" 
 data-regexp="^[A-Za-z ]+$" autofocus="autofocus">


  <label>Email address:</label>
  <input type="email" id="email_addr" name="email_addr" data-required="true" data-type="email" data-trigger="keyup">

But when I put it into table, even a small part of it, it fails to work.

    <table>
<tr><td>
<form  data-validate="parsley" id="registration_form" action="register.php" method="POST">

  <label>Full name:</label>
  <input type="text" id="full_name" name="full_name" placeholder="FirstName LastName" data-required="true" data-trigger="keyup" 
 data-regexp="^[A-Za-z ]+$" autofocus="autofocus">
</td></tr></table>

No errors from browser.

But what I find out is that if I am doing:

<form  data-validate="parsley" id="registration_form" action="register.php" method="POST">

before <table>, it work. However if I insert it (<form ...>) inside <td></td>, it fails.

As far as I know <form> tag is opened until </form> tag is given or until the end of document. Is it terminated asap parent tag is terminated? Can you explain what is my error?

Marc Audet
  • 46,011
  • 11
  • 63
  • 83
Tigran
  • 1,049
  • 3
  • 15
  • 31
  • Yes, i think the problem is your markup is not properly formed if the `
    `'s parent `` tag is closed before the ``
    – JofryHS Oct 03 '13 at 13:50
  • Could you post an example on jsfiddle or pastebin please ? – guillaumepotier Oct 12 '13 at 08:47
  • See this answer: http://stackoverflow.com/questions/5967564/form-inside-a-table . Actually, I have used a form inside a table with parsley, so it can work. I'm guessing that your HTML has some issue. – Turophile Jan 21 '14 at 21:57

0 Answers0