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



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


How to mark discussion as solved ?