Re: M. Lemos's form class questions
| From: | Meir Kriheli - MKsoft | Date: | Sun, 15 Oct 2000 09:09:13 +0000 |
| Subject: | Re: M. Lemos's form class questions | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20228@lists.php.net to get a copy of this message | ||
Hi Manuel,
After we've done with Interbase drivr (for now I guess :-),
I'll be glad to help you with the documentation.
Please cotact me off the list.
Meir Kriheli
MKsoft computer systems
'There's someone in my head but it's not me" - Pink Floyd
----- Original Message -----
From: "Manuel Lemos" <mlemos@acm.org>
To: <php-general@lists.php.net>
Sent: Sunday, October 15, 2000 12:00 AM
Subject: Re: [PHP] M. Lemos's form class questions
> Hello A.,
>
> On 11-Oct-00 01:33:09, you wrote:
>
> >Has someone managed to create drop down <select> box,
> >based on a SQL query, using Manuel Lemos' excellent
> >form class?
>
> I have a class ready for a few months now that does precisely that and
much
> more. My problem is the lack of time to make it useful by providing
> documentation and examples.
>
> Now that Metabase release with Interbase and Informix drivers were release
> I will concentrate my free time on that. First I will answer many of the
> requests and feature suggestions for the forms class. But it's all
> related.
>
> Once I update the forms class I alse will release a new killer class that
> wraps around the forms class to implement multi-page forms, like those
> Wizard like with back and forward buttons or with tabs to switch between
> pages randomly.
>
> Please hang on and be patient. Thank you.
>
>
> >The class requires to define an array, like:
>
> > $subscription->AddInput(array(
> > "TYPE"=>"select",
> > "NAME"=>"city",
> > "VALUE"=>"unknown",
> > "OPTIONS"=>array(
> > "unknown"=>"Unknown",
> > "0"=>"New York City",
> > "1"=>"Washington",
> > "2"=>"San Francisco"
> > ),
> > "ValidationErrorMessage"=>"Please select a city."
> > ));
>
> >and later on calls the method:
>
> >$subscription->AddInputPart("city");
>
>
> >I can create a function, which prints/echos this part
> >from the query:
>
> > $subscription->AddInput(array(
> > "TYPE"=>"select",
> > "NAME"=>"city",
> > "VALUE"=>"unknown",
> > "OPTIONS"=>array(
> > "unknown"=>"Unknown",
> > "0"=>"New York City",
> > "1"=>"Washington",
> > "2"=>"San Francisco"
> > ),
> > "ValidationErrorMessage"=>"Please select a city."
> > ));
>
> >, but how can I feed it here:
> >$subscription->AddInputPart("city"); so that it would
> >be accepted?
>
> I don't quite follow your doubt. You may read in the manual, that the
> AddInput function call just defines the input field properties. The
> AddInputPart just inserts the field as part of the form output, but what
> really outputs the form code with fields and whatever Javascript code
> is implied is the Output function.
>
> I don't know if this helped.
>
>
> >Also, how can I validate the selection, that it would
> >require to select one of the cities?
>
> The simplest way is to use instead of:
>
> "unknown"=>"Unknown"
>
> ""=>"Unknown"
>
> and then set the property "ValidateAsNotEmpty".
>
>
> Regards,
> Manuel Lemos