WhyNotDesign.com Home Tab WhyNotDomains.com Home Tab WhyNotDesigns.com Home Tab
WhyNotDesign.com RSS Feed
WhyNotDesign.com accepts Visa, Master Card, American Express, Discover, PayPal, Cash or Check
Why Not Design's Latest Web Design

Latest Web Design! (2007-11-19)
www.phreekindustries.com
Citrus Heights, CA, USA

Get 20% OFF!
Join the Why Not Design e-newsletter & we'll discount your first design purchase.
 

How to set form field values using JavaScript

Setting form field values from other values with javascript

*** BEFORE you do any of the following, it is ALWAYS a good idea to make a COPY of the file you are going to edit ***

1. The #1 thing you MUST know is that the NAME="yourVariableName" of each form field value you want to use in your script CANNOT contain any of the following or it simply WILL NOT WORK...

  • a hyphen (-)
  • a number (1,2,3,4,5,6,7,8,9,0)
  • an underscore (_)
  • any punctuation (, . ! ? ; : ' etc.)

2. We reccommend you use a naming scheme similar to ours to keep things in order and to make logical sense of your variable names and function names...

  • function names like: doThis(), doThat(), validateThisThing()
  • form field names like: firstName, lastName, myHomeAddress, myCellPhone
  • variable names (if you use them) like: varOne, price, grandTotal, salesTax

3. Here is our sample code

4. Once you have everything in place, it should function like this...

Address #1 :

Use Same Address as above :

Address #2 :

We really hope this has helped SOMEONE :-)

If it has please drop us a note at