[PHPLIB] RE: querying an attribute of a form element From: Alan Lee (alee <email protected>)
Date: 11/15/99

in case anyone was curious,

$f->elements[form_element_name]["ob"]->whatever_attribute;

returns the value assigned to whatever attribute in the form element.

So for the form element:

  $f->add_element(array(
         "type" => "radio",
         "name" => "Incidents",
         "question" => 1,
         "valid_e" => "#$x. ."));

  $f->elements["Incidents"]["ob"]->question; will return 1

The reason I wanted this is so that i could build the Question number
into each form element. That way, in case more questions (form items)
have to be added or questions have to be put in a different order, I
wont have to go back and change all the question numbers hardcoded into
the valid_e messages or in the browser display.

Does this make sense? (was there an easier way?)

A
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.