Sasha Oros schrieb:
> Hi,
>
>
> I'm trying to use an ajax post request and not sure why is not working.
>
>
> Code in a button:
>
> $.post( "HTMLTestPage.htm",
> {
> employeeID: "007",
> requestType: "R"
> },
> function(xml){
> alert( xml );
> alert( "BankName = " + $("#BankName", xml).val() );
>
> }
> );
>
>
> The 'HTMLTestPage.html' is an html page (not xml). When I click on the
> button the first alert returns the whole page and I can see the source code,
> id=BankName and value for the field, but the second alert returns an empty
> string. I tried using the text() and html() function, but the outcome was
> the same.
>
> By the way, when I created a test button on the 'HTMLTestPage.html' with
> 'alert( $("#BankName" ).val()' it worked and I got the value displayed.
>
HTML or XML returned by $.post or the other AJAX methods do not provide
a getElementById selector. You need to use other selectors or use
$([EMAIL PROTECTED], xml).
--
Jörn Zaefferer
http://bassistance.de
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/