Sales Question?
Willkommen, Gast

Almost there - Phone number validation
(1 Leser) (1) Gast
  • Seite:
  • 1

THEMA: Almost there - Phone number validation

Almost there - Phone number validation 1 Jahr, 1 Monat her #71712

I found this thread...
crosstec.de/en/forums/15-usage/12720-pho...mber-validation.html
which lead me to this answer...
crosstec.de/support/index.php?pid=knowle...wentclient&id=11
function ff_telephone_validation(element, message)
 {
  if(!isNaN(element.value) && element.value.length == 10){
   return '';
  }
  return 'Please enter a valid 10-digit phone number without dashes, periods, or brackets.';
 } // ff_telephone_validation

Now this works just fine other than one thing. When the form gives the errors about required fields this one does not add a line break so the next error shows up on the next line like the rest.

Being that I had to look up how to do this, I also don't know how to fix it. I tried adding a break in the code, but that just broke it completely.

I attached a pic to show what I am talking about.
Anhang:
  • blbeta
  • OFFLINE
  • Fresh Boarder
  • Beiträge: 2
  • Karma: 0

Aw: Almost there - Phone number validation 1 Jahr her #72302

Hi,
you are really almost there... you need to add a \n at the end of your error sentence:
return 'Please enter a valid 10-digit phone number without dashes, periods, or brackets.\n';

Regards

Viviana
  • drmenzelit
  • OFFLINE
  • Expert Boarder
  • Beiträge: 123
  • Karma: 0
Dr. Viviana Menzel
Dr. Menzel IT-Beratung
www.dr-menzel-it.de
Folgende Benutzer bedankten sich: blbeta

Re: Aw: Almost there - Phone number validation 1 Jahr her #72769

I knew it had to be something simple, but I just didn't have the knowledge. Thank you very much.
  • blbeta
  • OFFLINE
  • Fresh Boarder
  • Beiträge: 2
  • Karma: 0
  • Seite:
  • 1
Moderatoren: TheMuffinMan, ForumSupport
Ladezeit der Seite: 0.29 Sekunden

Über Crosstec

Crosstec GmbH & Co. KG

Hohenzollernring 57

50672 Cologne, Germany