Skip to content

Instantly share code, notes, and snippets.

@adamyanalunas
Created September 15, 2012 00:05
Show Gist options
  • Save adamyanalunas/3725693 to your computer and use it in GitHub Desktop.
Save adamyanalunas/3725693 to your computer and use it in GitHub Desktop.
Fix magic moving focus on franklabs.com/igs
function clearField(field)
{
if ( field && field.value )
field.value = '';
}
<form action="index.php?action=login" method="post">
<fieldset>
<span>Sign in</span> <a href="index.php?action=pwreset" title="Forgot Password?" id="help-icon">Forgot?</a>
<input type="text" class="text" name="email" placeholder="email" id="email" onfocus="clearField(this)"/>
<input type="password" class="text" name="password" placeholder="password" id="password" onfocus="clearField(this)"/>
<input type="image" src="-/img/btn-login.png" class="button" />
&nbsp;<a href="index.php?action=pwreset" title="Forgot Password?">Forgot?</a>
</fieldset>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment