Finish the execution of code after encountering validation |
[eluser]rochellecanale[/eluser]
Hello guys just wanna ask how can i cut the execution of code when i met the validation. Here's my sample code in view. Code: $memberid = $this->input->post('id'); My problem is when i met the validation (Meaning the user chose ewallet for method and the ewallet amount is not sufficient for payment). My code continue to execute it prompts the user 'You are insufficient of points. Use CASH for method payment instead.' And it continue to save and the page back to the sales transaction. How can i cut the execution of code? Please help me guys.
[eluser]noslen1[/eluser]
Did you try the Form_validation library with a custom validation rule ? User guide's documentation here
[eluser]jojo777[/eluser]
As noslen1 said use the Form_validation library and also you can include custom callbacks to the validation rules so you can control some data is what you want and if it pass the validation i'll be stored or whatever you want. Ask if you have some questions about this |
Welcome Guest, Not a member yet? Register Sign In |