PHP Classes

Using the date_class

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  Using the date_class  >  (Un) Subscribe thread alerts  
Subject:Using the date_class
Summary:Fatal error: Call to undefined method date_class::LoadInputValue
Messages:4
Author:Angela Gann
Date:2007-06-30 01:09:32
Update:2007-06-30 20:00:42
 

  1. Using the date_class   Reply   Report abuse  
Picture of Angela Gann Angela Gann - 2007-06-30 01:09:32
I am new to using this class and decided to try it out. When I did the date class, I'm getting a message that I'm missing arguments 3-8, though I set up my date input field the same way Manuel did in his presentation.

In addition to the code saying arguments 3-8 were missing, I'm also getting a message that the date_class::LoadInputValue method is undefined. I just went through the date_class file and I don't see LoadInputValue in there anywhere.

Am I missing a class the date_class is dependent on?

Here is what I have set up in the INPUT array:
$form->AddInput(array(
"TYPE"=>"custom",
"NAME"=>"reg_date",
"ID"=>"reg_date",
"CustomClass"=>"date_class",
"LABEL"=>"Registration Date",
"VALUE"=>strftime("%Y-%m-%d"),
"FORMAT"=>"(day)/(month)/(year)",
"Months"=>array(
"01"=>"Jan",
"02"=>"Feb",
"03"=>"Mar",
"04"=>"Apr",
"05"=>"May",
"06"=>"Jun",
"07"=>"Jul",
"08"=>"Aug",
"09"=>"Sep",
"10"=>"Oct",
"11"=>"Nov",
"12"=>"Dec"
),
"ACCESSKEY"=>"P",
"Optional"=>1
));

  2. Re: Using the date_class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-06-30 02:04:44 - In reply to message 1 from Angela Gann
I suspect that you have already another class named date_class in use in your script.

BTW, the correct parameter to set the date format is:

"Format"=>"{day}/{month}/{year}"

  3. Re: Using the date_class   Reply   Report abuse  
Picture of Angela Gann Angela Gann - 2007-06-30 15:19:18 - In reply to message 2 from Manuel Lemos
Thank you for your quick reply. I was looking at your video presentation to set this up and it was pixellated..I couldn't tell if those were brackets or parenthesis.

I am including your dateclass.php script on the same page. When I do the AddInput to set up the form field, should I be using date_class as the CustomClass name? I was thinking that CustomClass=>date_class was supposed to call your date_class(). Am I supposed to be providing a name there for the new object? (ie, $registration = new date_class .... CustomClass=>registration)

Example:
Instead of this:
$form->AddInput(array(
"CustomClass"=>"date_class", // name of your plugin

Should I be doing:
$form->AddInput(array(
"CustomClass"=>"registration", // name of the new object I want to create



Thank you again for your help!

  4. Re: Using the date_class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-06-30 20:00:43 - In reply to message 3 from Angela Gann
Yes, Google Video rescales the original videos. I should have tried to increase the font size.

Anyway, the video just exhibits the test_date_input.php script that comes with the class.

You should always use form_date_class as CustomClass parameter. You do should not create any object. You just pass the custom class name and the forms class creates the form_date_class object when it is necessary.