g
Printer Friendly Version

editor  
BellaOnline's ASP Editor
 

Auto Fill In Web Field Forms

Let's say you have a big contract page where you want a person's name to fill into many spots automatically when they type it in once. How do you do that?

First, put a form on the entire page, starting at the top and ending at the bottom. That way you can make calls to anywhere on the page to perform actions.

Next, create an input box where the user can type in their name. You can use:

Full Name:
<input type="text" name="username" size="50" MAXLENGTH="50" onChange="UserName(this.form,this.form.username.value)">

Next, the script called UserName. This is the script that is called any time a change is done to the above field. Put this right above where the form begins.

<SCRIPT LANGUAGE="JavaScript">
<!--
function UserName(form, username) {
form.userplace.value = username
}
// -->
</SCRIPT>

Finally, everywhere in the form where you want the form to fill in the name, use this:



You can do this for multiple fields - just make sure you change the name of the function and the fields in each case.

This site needs an editor - click to learn more!

ASP Site @ BellaOnline
View This Article in Regular Layout

Content copyright © 2013 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact Editor Wanted for details.



| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor