-
1. Re: Phone Number Format in Dreamweaver CS5 Form
Nancy OShea Feb 7, 2013 11:48 AM (in response to heatherfar69)It does not create the format.
#1 What format are you expecting?
#2 Use CSS to style your form
form {
font-weight:normal
}
Nancy O.
-
2. Re: Phone Number Format in Dreamweaver CS5 Form
Jon Fritz II Feb 7, 2013 12:16 PM (in response to Nancy OShea)Here's a little script I found that will format the phone number when they move to the next field in the form...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Phone Number</title>
<script language="javascript">
function addDashes(f)
{
f.value = f.value.slice(0,3)+"-"+f.value.slice(3,6)+"-"+f.value.slice(6,10);
}
</script>
</head>
<body>
<form>
Phone: <input type='text' name='phone' onblur='addDashes(this)'><br />
Cell: <input type='text' name='cell' onblur='addDashes(this)'><br />
Home: <input type='text' name='home' onblur='addDashes(this)'><br />
</form>
</body>
</html>
-
3. Re: Phone Number Format in Dreamweaver CS5 Form
heatherfar69 Feb 7, 2013 12:30 PM (in response to Jon Fritz II)I tried this and it does not work (see below).
<th style="text-align: right" scope="col">Zip:</th>
<th scope="col"><input name="Zip" type="text" id="Zip" size="70" /></th>
</tr>
<tr>
<th style="text-align: right" scope="col">Phone:</th>
<th scope="col"><input type='text' name='phone' onblur='addDashes(this)'/></th>
</tr>
<tr>
<th style="text-align: right" scope="col">Fax:</th>
<th scope="col"><input name="Fax" type="text" id="Fax" size="70" /></th>
-
4. Re: Phone Number Format in Dreamweaver CS5 Form
mhollis55 Feb 7, 2013 12:36 PM (in response to heatherfar69)Did you include the JavaScript code in the head of your page?
-
5. Re: Phone Number Format in Dreamweaver CS5 Form
heatherfar69 Feb 7, 2013 12:38 PM (in response to mhollis55)No, I was not aware that I had to. I am using the Dreamweaver form tools. What do I need to do for that?
Thanks!
-
6. Re: Phone Number Format in Dreamweaver CS5 Form
Nancy OShea Feb 7, 2013 12:56 PM (in response to heatherfar69)Go back to post #2. Copy & paste the code Jon gave you into a new, blank HTML document. Save and preview in browsers.
Nancy O.
-
7. Re: Phone Number Format in Dreamweaver CS5 Form
Jon Fritz II Feb 7, 2013 1:04 PM (in response to Nancy OShea)Specifically, the bold portion of my post with the <script>...</script> needs to be added between your page's <head> tags.
-
8. Re: Phone Number Format in Dreamweaver CS5 Form
heatherfar69 Feb 8, 2013 4:47 AM (in response to Jon Fritz II)Thank you, it works.