Re: Data Validation not working
Hello all Thanks for guiding me out of this problem. @ Dr. Loboto - Yes that was the problem. The model filename was Inventory.php. As soon as I changed it to inventory.php, it worked like a charm. Although why it worked on Windows local server and not on Linux web server is what I don't get. Anyway, as long as the problem is solved I won't complain. Thanks a lot. ShiVik On Mar 18, 12:08 am, logout stefano...@gmail.com wrote: I also vote for problems in the path/filename. Be sure exactly what file you edit (the model) - I had exactly the same problem - it turned out that i was editing a wrong file. When I opened the correct one, all worked fine. Your file for the model is inventory.php in the app/models, right? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: Data Validation not working
Linux is case sensitive, windows isn't At Linux, You can have at the same directory the files: inventory.php and Inventory.php Henrique Machado TI Expert 2010/3/19 SeeVik vikramvmalhotra1...@gmail.com Hello all Thanks for guiding me out of this problem. @ Dr. Loboto - Yes that was the problem. The model filename was Inventory.php. As soon as I changed it to inventory.php, it worked like a charm. Although why it worked on Windows local server and not on Linux web server is what I don't get. Anyway, as long as the problem is solved I won't complain. Thanks a lot. ShiVik On Mar 18, 12:08 am, logout stefano...@gmail.com wrote: I also vote for problems in the path/filename. Be sure exactly what file you edit (the model) - I had exactly the same problem - it turned out that i was editing a wrong file. When I opened the correct one, all worked fine. Your file for the model is inventory.php in the app/models, right? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe from this group, send email to cake-php+ unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: Data Validation not working
@sooraj: If using the form helper it automatically includes validation errors unless your suppress it by setting error=false Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Data Validation not working
I also vote for problems in the path/filename. Be sure exactly what file you edit (the model) - I had exactly the same problem - it turned out that i was editing a wrong file. When I opened the correct one, all worked fine. Your file for the model is inventory.php in the app/models, right? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Data Validation not working
actually you havent set the display option to show error in your view file ?php if($form-isFieldError('Inventory.make')) e($form-error('Inventory.make', null, array('class' = 'message'))); hope this solves your problem Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Data Validation not working
Probably there is an error at database level. Make sure your server table structure and constraints are the same of your local machine. On 15 mar, 01:20, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello all I am using CakePHP 1.2 and I am trying to implement a simple form data validation. The thing is that the data validation works on my local machine but it doesn't work on my rental server (Linux FreeBSD server). Here's my model ?php class Inventory extends AppModel { var $name = 'Inventory'; var $validate = array( 'make' = array( 'rule' = 'notEmpty', 'message' = '入力必須!' ) );} ? and view template ?php echo $form-create( 'Inventory', array( 'action' = 'index' ) ); ? ?php echo $form-input( make, array( div = false, label = :Maker, ) ); ? ?php echo $form-end( 'Send' ); ? Here's my controller ?php class InventoriesController extends AppController { var $name = 'Inventories'; var $uses = array( 'Inventory' ); function index() { if( $this-data ) { $this-Inventory-set( $this-data ); if( $this-Inventory-validates() ) { /* some logic */ } else { /* some other logic */ } } }} ? The problem is that the data gets set on the model, but the validates function always return true, even though I am submitting a blank form. What could be going wrong? Thanks and Regards ShiVik Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Data Validation not working
Hello there Lucca I double checked the server database. Its the same as local database. Since I am doing this application for test, there is only one table, not much room for error. Any other ideas as to how I can isolate the problem? Thanks and Regards ShiVik On Mar 15, 6:51 pm, Lucca Mordente luccamorde...@gmail.com wrote: Probably there is an error at database level. Make sure your server table structure and constraints are the same of your local machine. On 15 mar, 01:20, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello all I am using CakePHP 1.2 and I am trying to implement a simple form data validation. The thing is that the data validation works on my local machine but it doesn't work on my rental server (Linux FreeBSD server). Here's my model ?php class Inventory extends AppModel { var $name = 'Inventory'; var $validate = array( 'make' = array( 'rule' = 'notEmpty', 'message' = '入力必須!' ) );} ? and view template ?php echo $form-create( 'Inventory', array( 'action' = 'index' ) ); ? ?php echo $form-input( make, array( div = false, label = :Maker, ) ); ? ?php echo $form-end( 'Send' ); ? Here's my controller ?php class InventoriesController extends AppController { var $name = 'Inventories'; var $uses = array( 'Inventory' ); function index() { if( $this-data ) { $this-Inventory-set( $this-data ); if( $this-Inventory-validates() ) { /* some logic */ } else { /* some other logic */ } } }} ? The problem is that the data gets set on the model, but the validates function always return true, even though I am submitting a blank form. What could be going wrong? Thanks and Regards ShiVik Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Data Validation not working
Check model filename - it should be lowercased. If your model is not loaded you'll note absence of validation rules. On Mar 16, 7:57 am, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello there Lucca I double checked the server database. Its the same as local database. Since I am doing this application for test, there is only one table, not much room for error. Any other ideas as to how I can isolate the problem? Thanks and Regards ShiVik On Mar 15, 6:51 pm, Lucca Mordente luccamorde...@gmail.com wrote: Probably there is an error at database level. Make sure your server table structure and constraints are the same of your local machine. On 15 mar, 01:20, SeeVik vikramvmalhotra1...@gmail.com wrote: Hello all I am using CakePHP 1.2 and I am trying to implement a simple form data validation. The thing is that the data validation works on my local machine but it doesn't work on my rental server (Linux FreeBSD server). Here's my model ?php class Inventory extends AppModel { var $name = 'Inventory'; var $validate = array( 'make' = array( 'rule' = 'notEmpty', 'message' = '入力必須!' ) );} ? and view template ?php echo $form-create( 'Inventory', array( 'action' = 'index' ) ); ? ?php echo $form-input( make, array( div = false, label = :Maker, ) ); ? ?php echo $form-end( 'Send' ); ? Here's my controller ?php class InventoriesController extends AppController { var $name = 'Inventories'; var $uses = array( 'Inventory' ); function index() { if( $this-data ) { $this-Inventory-set( $this-data ); if( $this-Inventory-validates() ) { /* some logic */ } else { /* some other logic */ } } }} ? The problem is that the data gets set on the model, but the validates function always return true, even though I am submitting a blank form. What could be going wrong? Thanks and Regards ShiVik Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Data Validation not working
Hello all I am using CakePHP 1.2 and I am trying to implement a simple form data validation. The thing is that the data validation works on my local machine but it doesn't work on my rental server (Linux FreeBSD server). Here's my model ?php class Inventory extends AppModel { var $name = 'Inventory'; var $validate = array( 'make' = array( 'rule' = 'notEmpty', 'message' = '入力必須!' ) ); } ? and view template ?php echo $form-create( 'Inventory', array( 'action' = 'index' ) ); ? ?php echo $form-input( make, array( div = false, label = :Maker, ) ); ? ?php echo $form-end( 'Send' ); ? Here's my controller ?php class InventoriesController extends AppController { var $name = 'Inventories'; var $uses = array( 'Inventory' ); function index() { if( $this-data ) { $this-Inventory-set( $this-data ); if( $this-Inventory-validates() ) { /* some logic */ } else { /* some other logic */ } } } } ? The problem is that the data gets set on the model, but the validates function always return true, even though I am submitting a blank form. What could be going wrong? Thanks and Regards ShiVik Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en