Developer forum

Forum » Ecommerce - Standard features » Cart validation groups maximum length

Cart validation groups maximum length

Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi,

I've set a cart validation group to check the customer email maximum characters (as an example since seems to have the same behavior with all fields).
100 characters => passed validation;
110 characters => did not passed validation (my template is not outputting the error messages);
300 characters => checkout retrieved an exception;

This seems to happen when the field value length exceeds the DB field maximum characters.

I've tested this on 9.3.13 and 9.4.7.
https://www.screencast.com/t/67Y1yzZ06kA

BR, Mario


Replies

 
Nicolai Pedersen
Reply

Hi Mario

Yes, the database can only handle 255 characters. Do not try to use validation over 255 characters on database fields that does not support it.

BR Nicolai

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi Nicolai,

The validation was set to 100 characters on all scenarios described above. If the field value length is between the validation max chars and the DB field max length, the cart validation prevents the next step. If the field value length is over the DB field max length, a SQL exception is throwed.

BR, Mario

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Seems that it saves the post values on the DB before validating the data. Does this make sense?

BR, Mario

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

bump :)

 
Nicolai Pedersen
Reply

ok. You need to handle this in your template adding a maxlength to the input fields. This have never been an issue, and I see no reason to change flow currently.

BR Nicolai

 

You must be logged in to post in the forum