I'm trying to edit the [user-login] AutoTheme command to suit my needs. So far, I've changed it so that the default value is Username and Password. In addition, I want it so that when I click on the form, the field automatically clears (instead of me having to erase Username and Password). If I'm being unclear, the same type of setup can be found at www.gamers.nu , just click on the Login field, and it will erase. I've done a bit of research, and found that I need to add javascript to the tag,
Code
onClick="this.value=""" onFocus="this.value="""
However, when I add that code to the tag, it doesnt seem to work. Perhaps I'm adding it in the wrong place, but it seems like it wont pick up the javascript. Heres my userlogin code from atCommands.php that I've modified to my liking (without the onclick... onfocus... tags).
Code
$platformcmd['anonymous'] = array (
'user-login' => 'echo "<form action=\"user.php\" method=\"post\">\n'
.'
'
.' <input type=\"text\" value=\"Username\" name=\"uname\" onClick=\"this.value=\"\"\" onFocus=\"this.value=\"\"\" size=\"14\" maxlength=\"25\">\n'
.' <input type=\"password\" value=\"Password\" name=\"pass\" onClick=\"this.value=\"\"\" onFocus=\"this.value=\"\"\" size=\"14\" maxlength=\"20\">\n'
.' <input type=\"checkbox\" value=\"1\" name=\"rememberme\">\n'
.' <span class=\"pn-normal\">"._AT_REMEMBERME."</span>\n'
.' <input type=\"hidden\" name=\"module\" value=\"NS-User\">\n'
.' <input type=\"hidden\" name=\"op\" value=\"login\">\n'
.' <input type=\"hidden\" name=\"url\" value=\"index.php\">\n";'
.'$btn = "<input class=\"pn-button\" type=\"submit\" value=\""._LOGIN."\">";'
.'echo "$btn;<a href=\"user.php?op=register&module=NS-NewUser\">"._AT_NEWACCOUNT."</a> </form>";',
);
'user-login' => 'echo "<form action=\"user.php\" method=\"post\">\n'
.'
'
.' <input type=\"text\" value=\"Username\" name=\"uname\" onClick=\"this.value=\"\"\" onFocus=\"this.value=\"\"\" size=\"14\" maxlength=\"25\">\n'
.' <input type=\"password\" value=\"Password\" name=\"pass\" onClick=\"this.value=\"\"\" onFocus=\"this.value=\"\"\" size=\"14\" maxlength=\"20\">\n'
.' <input type=\"checkbox\" value=\"1\" name=\"rememberme\">\n'
.' <span class=\"pn-normal\">"._AT_REMEMBERME."</span>\n'
.' <input type=\"hidden\" name=\"module\" value=\"NS-User\">\n'
.' <input type=\"hidden\" name=\"op\" value=\"login\">\n'
.' <input type=\"hidden\" name=\"url\" value=\"index.php\">\n";'
.'$btn = "<input class=\"pn-button\" type=\"submit\" value=\""._LOGIN."\">";'
.'echo "$btn;<a href=\"user.php?op=register&module=NS-NewUser\">"._AT_NEWACCOUNT."</a> </form>";',
);
Could anyone help me figure out what the problem is here?
Thanks,
-NiV
