You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use DataTables for retail form rendering, one form per row, with different cells corresponding to different inputs.
As per http://stackoverflow.com/questions/5967564/form-inside-a-table forms are not allowed inside either <tbody> or <tr>, with the second answer indicating that setting the form attribute is a suitable workaround. However, I don't see any way to set that attribute with deform currently. It would make sense to be an argument to the serialize() function rather than being implemented per widget (just another attribute in the generated class).
For quick reference, a typical table row would look something like this (simplified) <tr> <td> <form id='form1' class='form'> <button type='submit' class='btn btn-default'>Submit</button> </form> <td> <input name='input1' class='form-control' form='form1'> </td> <td> <input name='input2' class='form-control' form='form1'> </td> </tr>
Currently I'm just calling a function which does a string replacement to insert the form='form1' line on the output of serialize, but something built-in to deform would be much preferred.
Have I missed something? Could this be added?
The text was updated successfully, but these errors were encountered:
Currently I'm just calling a function which does a string replacement to insert the form='form1' line on the output of serialize, but something built-in to deform would be much preferred.
You can have multiple forms in Deform. You need to make sure that all form fields have unique names. It may be better to put a form in each table cell, rather than each row. Personally I use datatables with links to edit individual records instead of editing records within the table.
Nonetheless I would gladly accept a PR with functional tests in deformdemo with your feature request.
I want to use DataTables for retail form rendering, one form per row, with different cells corresponding to different inputs.
As per http://stackoverflow.com/questions/5967564/form-inside-a-table forms are not allowed inside either
<tbody>
or<tr>
, with the second answer indicating that setting theform
attribute is a suitable workaround. However, I don't see any way to set that attribute with deform currently. It would make sense to be an argument to the serialize() function rather than being implemented per widget (just another attribute in the generated class).For quick reference, a typical table row would look something like this (simplified)
<tr>
<td>
<form id='form1' class='form'>
<button type='submit' class='btn btn-default'>Submit</button>
</form>
<td>
<input name='input1' class='form-control' form='form1'>
</td>
<td>
<input name='input2' class='form-control' form='form1'>
</td>
</tr>
Currently I'm just calling a function which does a string replacement to insert the
form='form1'
line on the output of serialize, but something built-in to deform would be much preferred.Have I missed something? Could this be added?
The text was updated successfully, but these errors were encountered: