Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Limiting Customer name and last name size
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

soncci
VP-CART New User

USA
97 Posts

Posted - March 06 2014 :  14:47:45  Show Profile  Visit soncci's Homepage  Reply with Quote
I need to put minimum limit size to my customers registration First and Last names.
Some customers like to just write initials and I need their name and last name in the database (SQL).
Also, some of them just write XXX. I used to handle this just deleting those customers but is getting worst and is time consuming.
I do not have any knowledge about SQL, I tried to find the function to add but no success.
I just need to add a minimum of 3 characters and no XXX to those two columns of fields.
Anyone can help?

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - March 08 2014 :  03:30:13  Show Profile  Reply with Quote
its bit easy, dont worry i will try to help you out of this case.

you find the file shopcustomerformdesign.asp, and open it, u search for this code :

sub ValidateCustomerFields
if strfirstname = "" then
SError = SError & GetLang("langCustFirstname") & GetLang("langCustRequired") & "<br />"
end if
if strlastname = "" then
SError = SError & GetLang("langCustLastname") & GetLang("langCustRequired") & "<br />"
end if

and change with my solution to :
sub ValidateCustomerFields
if strfirstname = "" then
SError = SError & GetLang("langCustFirstname") & GetLang("langCustRequired") & "<br />"
else
if len(strfirstname) < 3 then
SError = SError & GetLang("langCustFirstname") & "at least 3 chars" & "<br />"
else
if strfirstname = "XXX" or strfirstname = "xxx" then
SError = SError & GetLang("langCustFirstname") & "cannot be XXX or xxx" & "<br />"
end if
end if
end if

if strlastname = "" then
SError = SError & GetLang("langCustLastname") & GetLang("langCustRequired") & "<br />"
else
if len(strlastname) < 3 then
SError = SError & GetLang("langCustLastname") & "at least 3 chars" & "<br />"
else
if strlastname = "XXX" or strlastname = "xxx" then
SError = SError & GetLang("langCustLastname") & "cannot be XXX or xxx" & "<br />"
end if
end if
end if

try that and tell me :)
diego.
Go to Top of Page

soncci
VP-CART New User

USA
97 Posts

Posted - March 10 2014 :  18:36:11  Show Profile  Visit soncci's Homepage  Reply with Quote
Thank you very much Diego. Did work and very easy.

Excelente!! Gracias
Go to Top of Page

support
Administrator

4679 Posts

Posted - March 22 2014 :  01:01:27  Show Profile  Visit support's Homepage  Reply with Quote
Hi soncci, we are glad to hear that diego''s trick works for you. And here we would like to thank diego for sharing such helpful solution.

Thanks
VPASP ADMIN
Go to Top of Page

serjtankian
VP-CART Super User

Armenia
378 Posts

Posted - March 27 2014 :  07:43:01  Show Profile  Visit serjtankian's Homepage  Reply with Quote
great solution diego

muchas gracias !







*serj*
Go to Top of Page

soncci
VP-CART New User

USA
97 Posts

Posted - April 11 2014 :  11:52:58  Show Profile  Visit soncci's Homepage  Reply with Quote
I still have problems with some customers that register using just special characters instead of their real name and last name.

I was able to stop them from using XXX and or ... with the help of this forum friends and support, but if they type .\;,] it will register and then I need to delete that customer manually.

How could I make them to use only normal characters (A,a, B, b etc) , no numbers and no special characters when they register?

Edited by - soncci on April 11 2014 11:54:28
Go to Top of Page

serjtankian
VP-CART Super User

Armenia
378 Posts

Posted - April 29 2014 :  10:32:00  Show Profile  Visit serjtankian's Homepage  Reply with Quote
@soncci

easiest way is to add javascript, maybe this article would help you

http://www.aspsnippets.com/Articles/Restrict-user-from-entering-Special-Characters-in-TextBox-using-JavaScript.aspx






*serj*
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00