Re: M. Lemos's form class questions

From: Date: Sun, 15 Oct 2000 06:09:06 +0000
Subject: Re: M. Lemos's form class questions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20216@lists.php.net to get a copy of this message
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 Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --

« previous php.general (#20216) next »