Welcome Guest, Not a member yet? Register   Sign In
Help needed - Jquery remote validate plugin and CI
#1

[eluser]jahDsign[/eluser]
Hi everyone,

I have been stuck for some time on this problem and cannot really find a solution anywhere, so I have decided to go ahead and post it on this forum.

I am using the validate plugin from Jquery for a user registration and came across this problem:

here is an extract of my code -

model:
Code:
function check_exist_($Uemail)
  {
    $query_str = 'SELECT Uemail FROM users WHERE Uemail = ?';        
    $result = $this->db->query($query_str, $Uemail);
    
    //email exists
    if($result->num_rows() > 0)
    //email is not unique    
      return false;    
    else  
    //email is unique                        
      return true;    
  }

controller:
Code:
function JQ_unique_Uemail()
  {            
    $Uemail = $this->input->post('register_Uemail');
    if($this->User_model->check_exist_($Uemail))
      echo 'true';
    else    
      echo 'false';
  }

view:
Code:
<input id="register_Uemail" type="text" name="register_Uemail" value="<?php echo set_value('register_Uemail'); ?>" class="required email" />

$('#registerForm').validate({rules:{register_UconfirmPassword:{equalTo: '#register_Upassword'},register_Uemail:{remote:{url:"<?php echo $base_url.'pages/JQ_unique_Uemail'; ?>",type:'POST'}}},
                                   messages:{register_UconfirmPassword:{equalTo:'The passwords you have entered do not match.'},register_Uemail:{remote:'This email is already registered.'}}});

please note I have stripped out all unrelated information to my probelm...

So, the odd thing is when I view my page on my local server, it works perfectly: if the email is not registered in the DB, it is all good, and if the email is already registered, it shows up the error message dynamically.

Now, when I upload this code to my production server, it keeps coming up with the error message on Firefox, but in IE it actually crashes the javascript when I type anything on that input.

I have looked at the net stream in Firefox with Firebug, and when I type something in the email input, net stream shows the function being called (mysite/index.php/pages/JQ_unique_Uemail) but the status says "500 Internal Server Error"...

No idea where that could be comming from!

Has anyone ever come across this before?

Thank you very much,

Antoine.
#2

[eluser]Unknown[/eluser]
Hm .. it is interested for me too
#3

[eluser]danmontgomery[/eluser]
what does the apache error log say?
#4

[eluser]jahDsign[/eluser]
Hi noctrum,

thank you for your answer...

apache error log doesn't say much I am afraid...

It says this, which I don't think is related:

Code:
[Thu Sep 23 15:07:55 2010] [error] [client 212.124.236.1] File does not exist: /home/jahdsign/public_html/404.shtml
[Thu Sep 23 15:07:55 2010] [error] [client 212.124.236.1] File does not exist: /home/jahdsign/public_html/favicon.ico

Thanks,

Antoine.
#5

[eluser]jahDsign[/eluser]
Hello, has anyone got an idea of what the problem could be, please?

Thanks,

Antoine.




Theme © iAndrew 2016 - Forum software by © MyBB