[jQuery] JQuery for retrieving form fields?
Sorry if this seems totally inane, but is anybody using JQuery for
retrieving the values of form fields?
For the life of me I can't figure out how to get the value of a form
field via a JQuery lookup, see the testcase below.
Is this a bug, or does the problem lie between the headset?
Corey
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function test () {
alert($("input[@name='user']") + "\n"
+ $("input[@name='user']").value + "\n"
+ $("input[@name='user']").get() + "\n"
+ $("input[@name='user']").get().value + "\n"
+ $("input[@name='user']")._get() + "\n"
+ $("input[@name='user']")._get().value + "\n"
+ $("input[@name='user']").cur + "\n"
+ $("input[@name='user']").cur.value);
return false;
}
</script>
</head>
<body>
<form onsubmit="test(); return false;">
<input type="text" name="user" />
<input type="submit" />
</form>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/