• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
form validation - validation error before form submit

#2
[eluser]jahboite[/eluser]
Okay, I've solved this. I'm not exactly sure why, but the problem is a facebook thing.
Whenever one does a POST, fb adds certain things to the POST array. I was already aware of this, because before using a
Code:
$this->db->insert('table_name',$_POST);
I strip the fb stuff:
Code:
function unset_fbpost($uset)
    {        
        if (isset($uset['fb_sig_time']))
        {
            unset($uset['fb_sig_time']);
            unset($uset['fb_sig_added']);
            unset($uset['fb_sig_user']);
            unset($uset['fb_sig_profile_update_time']);
            unset($uset['fb_sig_session_key']);
            unset($uset['fb_sig_expires']);
            unset($uset['fb_sig_api_key']);
            unset($uset['fb_sig_in_canvas']);
            unset($uset['fb_sig_friends']);
            unset($uset['fb_sig']);
        }
        
        return $uset;
    }

Anyway, when using ONE view and posting to itself as in my previous posting, the POST array seems to trigger the validation on it's initial load because of the facebook stuff.
A combination of CI and facebook = weirdness!

So I solved it, by having an initial view which shows the form, but without the validation and which posts to another function.
This other function can then handle the validation as per my previous post.
Seems to work.

Hope this saves someone several hours!


Messages In This Thread
form validation - validation error before form submit - by El Forum - 10-21-2007, 03:22 PM
form validation - validation error before form submit - by El Forum - 10-21-2007, 07:54 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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