Telephon Check Box

Javascript code that automatically fills in the telephone number in all places needed after just once entering it and selecting a check box.


I ran accross this code when working on a registration product site. The goal is to save the user’s time by not having them fill in the same telephone number over and over, if the number is the same as other data fields.

You can view a working form by clicking here.

Source Code

<title>NSM | Tele Check Box</title>
Home Telephone:
<input name="home_phone" type="text" size="14" maxlength="12">
Work Telephone:
<input name="work_phone" type="text" size="14" maxlength="12">
<input type="checkbox" name="same_mail" onClick="work_phone.value=(this.checked)?home_phone.value:''">
(check if same as home number)

You may also like...

Leave a Reply