• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
validation error messages and Ajax

#1
[eluser]Ajaxian64[/eluser]
Hi all,

I submit a form via Ajax to a controller
On this controller I do this...
Code:
$this->form_validation->set_rules('description', 'Description', 'required');
$this->form_validation->set_rules('date', 'Date', 'callback_date_check');
$data['event_id'] = $event_id;
if ($this->form_validation->run() == FALSE)
  {        
     if (IS_AJAX) {
    $data['message'] ['message_label'] = form_error('description');
    $data['message'] ['message_date'] = form_error('date');
    echo json_encode($data);
     }
....
And in the function check :
Code:
function date_check($date) {
   // Just this try
   $this->form_validation->set_message('date_check', 'date should be xxx');
   return false;  
}
In my json message I'm unable to have the message from date_check...
I've only the message concerning required
-- My Json Object
{"event_id":"26","message":{"message_label":"<p>required<\/p>","message_date":null}}
--
Do you know why ?
Thanks


Messages In This Thread
validation error messages and Ajax - by El Forum - 08-09-2010, 02:49 AM
validation error messages and Ajax - by El Forum - 08-09-2010, 02:58 AM
validation error messages and Ajax - by El Forum - 08-09-2010, 03:51 AM
validation error messages and Ajax - by El Forum - 08-09-2010, 04:08 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.