Jump to content

Need help changing an input value onfocus


McMaster

Recommended Posts

I am trying to change the value of the "human" field to 1 when the name field is onfocus but I cannot seem to get it to work. Here is the code I have for it...

 

<form action="process.php" method="POST">
<input type="text" name="name" onfocus='document.getElementById("human").value="1"'  />
<input type="hidden" name="human" id="human" value="0" />
<input type="submit" value="go" />
</form>

 

Any help appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.