script help.... concatenation?

Status
Not open for further replies.

7aken

New Member
Hi All,

I need some help with a script. I know how to do this with php but cant figure it out for current script which is html and javascript. I have a login form which is basically username and password. my trouble is, with the way the script is the user has to enter there name and password @mydomain. i want to know how to concatenate this @mydomain so the user doesnt have to type this @mydomain

how do i do this?

 

RedCardinal

New Member
Haven't coded JS in a while so here we go. I'll assume that you can capture the value of the password input into, say,
Code:
var passwordInput = document.getElementById('password');
var password = passwordInput.value;
passwordInput.value = password + '@mydomain';
I'm sure that there is a ncier way to do this - I just cant think of it right now.
Code:
document.getElementById('password').value += '@mydomain';
Christ, I really have to touch up my JS skills :(
 
Status
Not open for further replies.
Top