FORMfields, the premiere web framework
Login
Support Home | Knowledge Base | Documentation | Forums | Contact Us
Info
FORMfields & FORMgen :: Errors

Fatal error: Call to a member function on a non-object in ...

(3075 views. Last Updated: 2007-10-24 1:02 AM)

If you are getting the error:
Fatal error: Call to a member function on a non-object in ...
then you are most likely referencing a field by an invalid name. This can occur when you misspell a field name or change the capitalization. Remember, field names must be the same throughout your program. For example, the following is valid:
...
$ffFrom->addField(new PersonNameField("my_name", "My Name", FORM_FIELD_REQUIRED));
$ffForm->setHelp("my_name", "Please enter your full name");
...
However, none of the following are valid:
...
$ffFrom->addField(new PersonNameField("my_name", "My Name", FORM_FIELD_REQUIRED));     
$ffForm->setHelp("my_Name", "Please enter your full name"); // This line will generate an error
...
or
...
$ffFrom->addField(new PersonNameField("my_name", "My Name", FORM_FIELD_REQUIRED));
$ffForm->setHelp("myName", "Please enter your full name"); // This line will generate an error
...
etc...
Info
Support | Earn Money
Copyright © 2005-2019 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.