Jump to content
Larry Ullman's Book Forums

Validation Rule Or Removing White Space?


Araquach
 Share

Recommended Posts

I'm building a customer feedback form where upon submission a voucher is sent via SMS text message. I'm using the YiiMail extension to handle sending the text message. It's all working well.

My only issue arrises when the applicant breaks up their mobile number with spaces when inputting it, as this doesn't validate in Swift mailer.

What is the best approach? Do I need to create a new validation rule or does Yii provide one for this scenario? Or would you recommend creating a function to strip the spaces out after validation? If that's the case, how would I go about implementing this (I still struggle with where to place this kind of functionality - I'm pretty new to OOPHP).

Would appreciate the help!

Link to comment
Share on other sites

 Share

×
×
  • Create New...