I have the following in a simple form;
<form method="post" action="inc/core.php">
<input type="textbox" name="lognick" value="samp" />
<input type="password" name="logpass" />
</form>
I’m trying to get their value through;
var logname = $("input[name=lognick]").val();
var logpass = $("input[name=logpass]").val();
logname always returns “samp” (the default value) and logpass undefined. I also tried using .attr("value") but it’s the same outcome.
When trying to use it on a blank page it works flawlessly.
Here’s the whole onclick function; http://pastebin.com/pQiVAuEW
Thanks!
I can’t replicate the problem and I am able to access the value fine. The password box has no value so it should be undefined.
See this JSFiddle.