Date: 11/21/00
- Next message: Leif Jakob: "Re: [phplib] optional form fields"
- Previous message: Douglas Forrest: "[phplib] Using cookies with phplib to enable automatic login: solved!"
- Next in thread: Leif Jakob: "Re: [phplib] optional form fields"
- Reply: Leif Jakob: "Re: [phplib] optional form fields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
I have a quick question for the OOH form gurus on the list. What is the
best way to implement optional fields in a form? What I want to do is
this: a user should be able to leave certain optional fields blank, but
if they enter something then I want to make sure they enter something
valid. I've been using OOH forms for a long time and for some reason
I've never had to do this before. Now I have to and I don't see
anything in the docs that describes this. Perhaps one could do
something like this:
$f->add_element(array("type" => "text",
.....
"required" => 0));
which would indicate that the field isn't required. The validation of
the form input would ignore this field if the user didn't enter
anything, but if he/she did, then it would validate the input according
to valid_regex.
I know there's been discussions about new forms classes written by Ulf
Wendel, but I'm not sure if the new code handles this. Also, right now
I'm not in a position to upgrade.
Thanks for any suggestions
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Leif Jakob: "Re: [phplib] optional form fields"
- Previous message: Douglas Forrest: "[phplib] Using cookies with phplib to enable automatic login: solved!"
- Next in thread: Leif Jakob: "Re: [phplib] optional form fields"
- Reply: Leif Jakob: "Re: [phplib] optional form fields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

