This is my HTML outputted code:
<tr class="uedit103" style="display: none;"><form id="editform103" name="editform103">
<td class="base" id="uedit103"><input type="text" class="editua" name="lname" id="lname" value="inte"></td>
<td class="base" id="uedit103"><input type="text" value="info" class="editua" name="fname" id="fname" ></td>
<td class="base" id="uedit103"><input type="text" value="email@email.com" class="edituaxl" name="emailadres" id="emailadres" ></td>
<td class="yellow
"><select name="ma_accesslevel"><option value="0" >Basic</option><option value="1" SELECTED >Intermediate</option><option value="2" >Superuser</option></select></td>
<td class="yellow
"><select name="m_accesslevel"><option value="0" >Basic</option><option value="1" SELECTED >Intermediate</option><option value="2" >Superuser</option></select></td>
<td class="yellow
"><select name="hcc_accesslevel"><option value="0" >Basic</option><option value="1" SELECTED >Intermediate</option><option value="2" >Superuser</option></select></td>
<td class="base" id="uedit103"><input type="hidden" class="editua" name="uid" id="uid" value="103"></td>
<td class="base" id="uedit103"><input type="button" id="editsubmit103" class="editbutton" Value="Save"><input type="button" id="editcancel103" class="editbutton" Value="Cancel"></td>
</form></tr>
The jQuery part is this (alert added for debugging):
$('#editsubmit$ses->user_id').click(function(){
$.post('ajax/aj_edituser.php', $("form#editform$ses->user_id").serialize(), function(result) {
alert($("form#editform$ses->user_id").serialize());
$('#success$ses->user_id').delay(200).fadeToggle('slow').delay(2000).fadeToggle('slow');
$('div.mainadmin').html(result);
});
});
Works in all browsers, except FF, which fails the second time the form is submitted (the form is reloaded in the open page). When validating the HTML, or looking into the source code in FF, the form tag
<form id="editform103" name="editform103">
is put in red and gets the message “Start tag form seen in table”. The closing form tag is also put in red and gets the message “Stray end tag form”.
Validating the code via http://validator.w3.org/ also gives me these errors + “Element form not allowed as child of element tr in this context. (Suppressing further errors from this subtree.)” on the editform. So I’ve tried putting the form around the tags too, but didn’t help.
I don’t see this anymore, anyone who can help?
It invalid HTML to put form tag inside TR tag or TABLE tag, you need to put it eather inside TD or around the whole TABLE