Set Requirements for the Field
To require the user to enter a telephone number in correct format (although there is no easy way to ensure it actually is a real telephone number), use the settings in the properties box for the widget itself by clicking on the name that appears above the text field. In this example the widget is described as “Spry TextFiled: sprytextfield1." One option is the Type, where a drop-down list offers preset types such as email address, date, time, credit card, phone number, Social Security, currency, IP address and more. There is a custom option as well. In cases where formats might differ depending on the country, another field for format can set this. You can choose US-5, US-9, Canada or UK as presents, or create your own custom format. Additional options are in the properties settings including minimum and maximum characters and values.
In the code, the telephone type setting looks like this:
Var tfl=new Spry.Widget.ValidationTextField(“sprytextfield1", “phone_number")’
Add a “Submit" button and edit the form action to meet whatever system your Web host uses for processing forms, upload this, and test. Alternatively, you can use the “Preview in Browser" option in Dreamweaver, although you may have to edit your security settings to allow access to the Preview option.