<a href="#addFriend" rel="facebox" title="[+] add <?php echo $showU["full_name"]; ?> as friend">
<div class="addFriend"></div></A>
<div id="addFriend" style="display:none; margin: auto;">
<form action="javascript:DoFriendRequest()" method="post">
<input name="commentFriend" type="text" id="commentFriend" value="" size="22">
<input name="submit" type="submit" id="submit" value="Send">
</form>
</div>
My form when it's inside this element which is a jquery lightbox, the field #commentFriend get empty value in DoFriendRequest
function DoFriendRequest() {
var wrapperId = '#insert_svar';
$.ajax({
type: "POST",
url: "misc/AddFriendRequest.php",
data: {
mode: 'ajax',
comment : $('#commentFriend').val()
},
success: function(msg) {
$(wrapperId).prepend(msg);
$('#commentFriend').val("");
}
});
}
Updated answer
But when I remove the display:none, it works. How can I solve this?