Community discussions

MikroTik App
 
win9x
just joined
Topic Author
Posts: 10
Joined: Tue Dec 23, 2014 8:39 am

improve hotspot login page

Tue Dec 23, 2014 8:48 am

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
 
win9x
just joined
Topic Author
Posts: 10
Joined: Tue Dec 23, 2014 8:39 am

Re: improve hotspot login page

Tue Dec 23, 2014 4:44 pm

i need to add a code in html login page to remove spaces in username field
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: improve hotspot login page

Tue Dec 23, 2014 9:03 pm

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();
 
win9x
just joined
Topic Author
Posts: 10
Joined: Tue Dec 23, 2014 8:39 am

Re: improve hotspot login page

Wed Dec 24, 2014 12:05 am

thanks a lot man
its work very well
:D
 
win9x
just joined
Topic Author
Posts: 10
Joined: Tue Dec 23, 2014 8:39 am

Re: improve hotspot login page

Thu Jan 15, 2015 12:57 am

if i want to disable capital litters and @#$%
can anyone help me :shock:
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: improve hotspot login page

Thu Jan 15, 2015 9:00 pm

if i want to disable capital litters and @#$%
can anyone help me :shock:
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;
}
 
win9x
just joined
Topic Author
Posts: 10
Joined: Tue Dec 23, 2014 8:39 am

Re: improve hotspot login page

Fri Jan 16, 2015 2:43 am

god bless you :D

but the first one about "space " work for while and now dosnt work !!
 
User avatar
hossain2004a
Member Candidate
Member Candidate
Posts: 247
Joined: Mon Dec 22, 2014 7:34 pm
Location: Iran

Re: improve hotspot login page

Fri Jan 16, 2015 11:02 am

why dont you reset your hotspot html??
easiest way!!
 
win9x
just joined
Topic Author
Posts: 10
Joined: Tue Dec 23, 2014 8:39 am

Re: improve hotspot login page

Fri Jan 16, 2015 11:18 am

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
 
StevenThelen
just joined
Posts: 1
Joined: Wed Jan 21, 2015 10:01 am

Re: improve hotspot login page

Wed Jan 21, 2015 10:28 am

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/

Who is online

Users browsing this forum: erlinden, NebularWinter, Wintxi and 99 guests