Discussion Locked

autofill "@domain.com" in a text box

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I created on online access form to gain access to a web site on my company intranet. In the form we ask for both the user's & their manager's email address.
What I want to do is similar to what Microsoft has done with their Hotmail login screen. There, a user types their username and when you press Tab, it automatically fills in @hotmail.com.
So, what I am wanting to do is add this type of function to my form, so that when they begin typing and press tab, that it fills in @domain.com, "domain" being replaced by our company name.
Does anyone know how to write the code to do this or if it can be done? I'm not using it for a login page, I just need it to autofill a textbox.

Thanks
MT

1 reply

by nikki96

Sure. Just javascript to capture the tab key and append the string to the input.
View the source of the page that does it. The code is either there or in a linked js file.

This discussion is closed to new replies.