close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


WAValidatePN problem

Thread began 9/04/2011 4:34 pm by davidrmilne363485 | Last modified 9/06/2011 10:53 pm by davidrmilne363485 | 683 views | 2 replies |


WAValidatePN problem

I am having problem with a phone number field. When I enter 555-555-1212 it reformats it to (555) 555-1212 and then tells me that I have exceeded the maximum number of characters.

Go to registration.php to duplicate the error. This page was built with CSS Form Builder 2.0.

Here are two code snippets that show the calls to WAValidatePN

$WAFV_Errors .= WAValidatePN((isset($_POST["Phone_Number"])?$_POST["Phone_Number"]:"") . "",false,true,true,4);


<input id="Phone_Number" name="Phone_Number" type="text" value="" class="formTextfield_Large" size="15" tabindex="4" onblur="WAValidatePN(document.getElementById('RichRegistration_NewFromBlank_Default').Phone_Number,'',false,true,'x (xxx) xxx-xxxx',document.getElementById('RichRegistration_NewFromBlank_Default').Phone_Number,0,true);"/>
<span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span><span class="textfieldRequiredMsg">Please enter a 10 digit phone number</span> </span>

Thanks for your help.



Sign in to reply to this post

Jason ByrnesWebAssist

the spry validation code for the phone number field is set to restrict the maximum characters for the phone number field to 14:

var Phone_Number_Spry = new Spry.Widget.ValidationTextField("Phone_Number_Spry", "phone_number", { format:'phone_us', maxChars:14 , validateOn:["blur"]});

the format:
x (xxx) xxx-xxxx

is 16 character long though, to use that format, you will need to change the spry validation to allow for 16 characters.

Sign in to reply to this post


Thank you

Changing the spry variable fixed the problem.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...