kvarnerexpress 0 Report post Posted October 26, 2005 I've got the following function, that has a function inside of it, when I run it I get the followin error:PHP Code: Fatal error: Call to a member function on a non-object in See the code below where I get the error message. I'm guessing the scope of my varaibles is messed up, but I'm not sure how to fix it. I've abbreviated the code so as to make it easier to read.PHP Code:function getMemberRegistrationForm( &$tpl, &$db ){ function displayRegistrationForm( $action, &$db, $defaults = NULL, $id = NULL ) { global $registrationForm; $registrationForm = new HTML_QuickForm('registrationForm'); $registrationForm->addElement('text', 'lname', 'Last Name:', array('size' => 40, 'maxlength' => 255 )); } if( $registrationForm->validate() ) // <-This is where I get an error { $registrationForm->freeze(); } else { displayForm( $registrationForm, $tpl, 'additional_content'); }}getMemberRegistrationForm( $tpl, $db); Thanks,kvarnerexpress Share this post Link to post Share on other sites
dul 0 Report post Posted October 27, 2005 *BLEEP*ing hell. What is your registrationForm's source. Does it include that Validate() functuon??? Share this post Link to post Share on other sites
HmmZ 0 Report post Posted October 29, 2005 First of all, sorry if i confuse you, i dont work with such codes (->,=>)Shouldn't the call to validate() need variables provided to send to ?Check if you defined all your functions correctly, check the following:*validate()*freeze()*displayForm()Hope this helps, even a little bit :/ Share this post Link to post Share on other sites
magiccode9 0 Report post Posted November 3, 2005 hi, kvarnerexpress i dont think that a function can within another function. but following the error displayed, it should be mean you have try to call an method but that method not included in a object ==> the HTML_QuickForm might not be a class. try search if it found HTML_QuickForm class or not.- hope this help Share this post Link to post Share on other sites
arboc7 0 Report post Posted November 4, 2005 All I can think of is if validate() is a function that exists (and your other functions also exist) when the getMemberRegistrationForm() function executes...Sorry I can't help much...but good luck!! Share this post Link to post Share on other sites