jQuery val() inside display: none

Posted in dotnet, vb, vb.net | 2 Comments »

    <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

data: {
mode: 'ajax',
comment : $('#commentFriend').val()
},

But when i remove the display none; it works, how can i solve this?

Similar:

  1. Using an ID to Reply to a Comment with jQuery in a Sping-MVC app I need to be able to comment to an article, but also be able to reply to a comment using the same form. Fairly simple,...
  2. What to use for a Lightbox inside a lightbox? Hi, I have a form which pops up inside a lightbox via a link. Within the form there is a field which needs explaning to...
  3. jQuery Validation: Validate dynamicly generated fields only on the first field. Hello, Yes, I know this question has been asked a few times before. But I am confused with the answers. I thought I would have...
  4. jQuery form validation issue I’m not using any jQuery plugin to validate the form, just plain jQuery. My issue is that after it validates all the input elements, even...
  5. passing an input field value through a querystring using jquery I trying to store the value of the input field tbEmail into str so when the user clicks the submit button the value of tbEmail...

2 Responses to “jQuery val() inside display: none”

Leave a Reply