JS dans le login

This commit is contained in:
Alan Garcia 2013-02-01 16:31:47 +00:00
parent 32346783a2
commit e9b187ba29
1 changed files with 88 additions and 79 deletions

View File

@ -46,6 +46,7 @@ if (!$charset) $charset="UTF-8";
<title>AlternC Desktop</title>
<link rel="stylesheet" href="styles/style.css" type="text/css" />
<script type="text/javascript" src="js/alternc.js"></script>
<script src="js/jquery.min.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
</head>
<body>
@ -77,7 +78,7 @@ if (!$charset) $charset="UTF-8";
<tr><td colspan="2" align="center"><b><?php __("AlternC access"); ?></b></td></tr>
<tr><td align="right"><label for="username"><?php echo _("Username"); ?></label></td><td><input type="text" class="int" name="username" id="username" value="" maxlength="128" size="15" /></td></tr>
<tr><td align="right"><label for="password"><?php echo _("Password"); ?></label></td><td><input type="password" class="int" name="password" id="password" value="" maxlength="128" size="15" /></td></tr>
<tr><td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Enter"); ?>" /><input type="hidden" id="restrictip" name="restrictip" value="1" /></td></tr>
<tr><td colspan="2" align="center"><input type="submit" class="inb" name="submit" onClick='return logmein();' value="<?php __("Enter"); ?>" /><input type="hidden" id="restrictip" name="restrictip" value="1" /></td></tr>
</table>
<input type="hidden" id="authip_token" name="authip_token" value="<?php echo htmlentities( (empty($authip_token)?'':$authip_token) ) ?>" />
</form>
@ -135,6 +136,14 @@ if (!$charset) $charset="UTF-8";
</div>
<script>
document.forms['loginform'].username.focus();
function logmein(){
if ( $('#username').val() =='' || $('#password').val() =='' ) {
alert('<?php __("Need a login and a password"); ?>');
return false;
}
return true;
}
</script>
</div>