HomeHome Product Discus... Product Discus...SmithCartSmithCartaccount/payment form fields - validationaccount/payment form fields - validation
Previous
 
Next
New Post
9/3/2010 8:08 AM
 

Hi, Is it possible validate the forms fields?
I mean, phone number only allows number, zip code only allows number, street needs letters and numbers, and so on....

Thanks in advance,

 
New Post
9/4/2010 3:56 PM
Accepted Answer 

The fields on the payment form like credit card, expiration date, ccv2 code, etc are already validated. Credit card number is validated using a mod 10 check. If you open up the page you want to add the validation to, for example if you want to add validation to the phone field on the step 1 page open up step1.ascx located in \desktopmodules\smith.buynow and scroll down to the control you want to add validation to and add the following validation control:

<asp:RegularExpressionValidator ID="rfvPhone1" ValidationExpression="^([0-9\(\)\/\+ \-]*)$" runat="server" ErrorMessage="Enter a valid phone"/>

You can see its already there in the page and just commented out. We had added validation on the fields phone, postal code, etc but had to comment it out becuase it wasnt working for the all the possible variations around the world and people get fruistrated when they enter something and they get a message to enter in the proper format.


At your service,
Dave Smith
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartaccount/payment form fields - validationaccount/payment form fields - validation