Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

[SOLVED] How to sanitize user input before validation ?

I want to sanitize phone number input by user before I validate it.

Normally user will enter phone number like "019000000". But sometime , they will enter "6019000000". No 6 is country code for Malaysia.

I want to remove No 6 , before I validate it. I want to check to make sure that , the phone number is not in database. But , if not remove No 6 , it will provide different result. My code http://pastebin.com/sNm7cdY8

Thanks.

Update

I have solved this problem. Just need to check user input , before pass the data to $form->isValid();



84.5k
Accepted
answer

How to mark discussion as solved ?