Author |
Topic |
|
twopigs
Starting Member
USA
11 Posts |
Posted - May 27 2009 : 10:11:26
|
hello, We had some customers getting errors, and I tracked it down to them trying to put too much information in the signup form. is there a way to limit the number of characters in the form fields. I am not understanding the way vpasp is setup to create these dynamic forms? i thought i could just go in and set the size of the form field, but being that it's dynamically created i can't figure it out. Thanks in advance for any help! Scott |
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - May 27 2009 : 13:14:53
|
the "size" aspect of a field just relates to the physical width of the field and doesn't have any effect on how many characters someone can enter.
what you're after is maxlength (but that doesn't work on textareas or some browsers) which stops the customer from physically entering more than a given number of characters
it can be done from client or server side or both (eg client side with maxlength and/or javascript validation, and server side with the vbscript validation)
we're actually working on a javascript customer-form validation module at the moment to check if mandatory fields have been entered before it's submits the form
the vpasp side of the code is a bit like spaghetti and hard to follow on the customer forms; we're trying to add a simple plugin where you just have a config file where you specify the basics of your validation needs for each field.
this includes things like being able to check if someone's ticked the "terms-agreement" box as well as whether or not they've entered mandatory text fields, or chosen a value in a mandatory poplist, all done on the client-side so the user gets a nice simple alert and the cursor focuses on the field.
we'll probably be adding min/max character lengths too as an option to it.
if you want to check it server-side, the relevant function is:
Sub ValidateData
in shopcustomer.asp
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
|
|
hpride
Starting Member
11 Posts |
Posted - June 10 2009 : 22:42:27
|
Hi Simon
So that means if I were to force a a field (e.g. Post Code) to only accept 4 characters max in length, and numeric only, on our database, that it would either not work or produce errors?
Anthony |
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - June 11 2009 : 03:14:24
|
hi, correct; if you reduce the length of the column in the database and someone enters a value longer than the column allows then you'd get a vbscript/sql error (ie not a proper/user-friendly one).
We did create/release the addon mentioned above the other day, so it's now ready/live: BYZ157 - Order Form JavaScript Validation for VP-ASP: http://www.bigyellowkey.com/mysoftware_product_details.asp?prdid=359&opu=n
However, that only relates to the order form (shopcustomer.asp) not the seperate registration-specific or mail-signup page. But as customers confirm their details when ordering via that page (shopcustomer.asp) regardless of whether new or old then it means they will go through the javascript validation at the point of ordering.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
|
|
|
Topic |
|