jQuery might be a little slow for this need, try using regular DOM selectors, it would be faster and easier.

On 8/10/06, Chad Lansford < [EMAIL PROTECTED]> wrote:
I'm new to jQuery, and I'm having a problem grabbing the value from a textbox or textarea.

I searched the past discussions and found this issue:

http://jquery.com/discuss/2006-July/008603/

This is basically what's happening to me, but I couldn't find the resolution I was hoping for in the past discussions.  The interesting thing is that the same thing happens if I try to use "document.getElementById ('elemid').value;" - so... it may or may not be a jQuery issue at all.

Anyway, I'd appreciate any help you all could offer... I'm pulling my hair out...

Here's the code snippets:

HTML:

<input name="SendMessage1:hdnID" id="SendMessage1_hdnID" type="hidden" />
<input name="SendMessage1:hdnSID" id="SendMessage1_hdnSID" type="hidden" />
<input name="SendMessage1:hdnMessageType" id="SendMessage1_hdnMessageType" type="hidden" />
<input name="SendMessage1:txtMessageSubject" type="text" id="SendMessage1_txtMessageSubject" />
<textarea name="SendMessage1:txtMessageBody" id="SendMessage1_txtMessageBody"></textarea>
<input type="button" id="btnSubmit" value="Send Message" false;"/>

_javascript_:

function sendUserMessage() {
var id = $("#SendMessage1_hdnID").val();
var sid = $("#SendMessage1_hdnSID").val();
var type = $("#SendMessage1_hdnMessageType").val();
var subject = $("#SendMessage1_txtMessageSubject").val();
var body = $("#SendMessage1_txtMessageBody").val();

alert(id);  //returns correctly
alert(sid);  //returns correctly
alert(type);  //returns correctly
alert(subject);  //ONLY returns original value, not the updated text
alert(body);  //ONLY returns the original value, not the updated text

//test
alert(document.getElementById("SendMessage1_txtMessageSubject").value);  //ONLY returns original value, not the updated text
alert(document.getElementById("SendMessage1_txtMessageBody").value);  //ONLY returns original value, not the updated text
}

Chad

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to