Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-18-2005, 07:39 AM   #1 (permalink)
leisse
Registered User
 
Join Date: May 2005
Posts: 3
leisse is on a distinguished road
javascript type ahead

I have a few text boxes on my form, including one for a username and one for an email address. Both textboxes are the same with the exception of the @domain on the end of the email address. What I want to do is force the user to enter the username, and when they move to the next text box, have that username prepopulated in the email address text box. For example, after I type the username "leisse" in the username text area and I move onto to say the birthdate text area, I want "leisse" to automatically show up in the email address text area and I will append the @domain to the username. Any suggestions?
leisse is offline   Reply With Quote
Old 05-18-2005, 08:03 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
Code:
<script language="JavaScript">
function populate(text)
{
     document.my_form.email.value = text + "@domain";
}
</script>
<form name="my_form" action="what_ever" method="post">
<input type="text" name="name" value="" onUnFocus="javascript:populate(this.value)"> 
<input type="password" name="password" value=''>
<input type="text" name="email" value="">
</form>
Should give you an idear.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie cant figure out Javascript Error JediNewbie HTML, XML, Javascript, AJAX 8 04-17-2005 10:15 PM
A drop down menu you can type into fightingillini HTML, XML, Javascript, AJAX 11 12-29-2004 08:07 AM
javascript alert without refreshing? sde HTML, XML, Javascript, AJAX 2 06-30-2004 11:52 AM
Changing variable type for edit box : mfc - .net sde Standard C, C++ 0 01-31-2003 09:53 AM


All times are GMT -8. The time now is 02:04 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting