improve hotspot login page

hi guys

In the hotspot login page
In the username field
i have a little problem
some devices specially android mobile
leave space at the first of username field
and when the customer login it show an error that the user or password invild because most of them not notice the space that adding automatically to first of user field

so if any one can help me to edit the login page to auto remove spaces from user and password field

thaks alot

i need to add a code in html login page to remove spaces in username field

Edit the login.html page, find the line that says:

document.sendin.username.value = document.login.username.value;

and change to:

document.sendin.username.value = document.login.username.value.trim();

thanks a lot man
its work very well
:smiley:

if i want to disable capital litters and @#$%
can anyone help me :open_mouth:

Edit login.html and replace the doLogin() function with the code below. I assume you want to disallow all special characters, so this allows only lowercase and numbers.

function doLogin() {

if (!/^[a-z0-9]+$/.test(document.login.username.value)) { 
	alert("ERROR: Username must only contain lower case letters and numbers!");
	document.login.username.focus();
	return false;
}

document.sendin.username.value = document.login.username.value;
document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
document.sendin.submit();
return false;
}

god bless you :smiley:

but the first one about "space " work for while and now dosnt work !!

why dont you reset your hotspot html??
easiest way!!

i will do
but that last one appears a warning message
is there a way to convert capital to small and auto delete @#$% from the field

very useful and lucky for me to read this. I met the issue with the login page as you did and get the code, too. It work very well. Tks a lot


http://ragednareviews.com/