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.

Introduction:

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

<html>
<head>
<title>NSM | Tele Check Box</title>
</head>
<body>
<form>
Home Telephone:
<input name="home_phone" type="text" size="14" maxlength="12">
<br>
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)
</form>
</body>
</html>

You may also like...

Leave a Reply