|
Posted by Jon Slaughter on 05/22/07 12:13
"Jon Slaughter" <Jon_Slaughter@Hotmail.com> wrote in message
news:zXA4i.1705$u56.121@newssvr22.news.prodigy.net...
>
> "Toby A Inkster" <usenet200703@tobyinkster.co.uk> wrote in message
> news:ikgai4-s96.ln1@ophelia.g5n.co.uk...
>> Jon Slaughter wrote:
>>
>>> What I mean is, say I want to insert a div for absolute positioning
>>> of some element inside a form... can I do that with your class easily?
>>
>> Not yet, no. It wraps a good few elements round each form control by
>> itself though, most of which have classes and IDs, so can be styled as
>> required. The comment forms on my website are one example.
>>
>>> Your set_validity_check seems to be very similar to what I was doing
>>> except I didnt' call it validation and mine is more primitive. Mine
>>> simply
>>> executes code and that code can be anything. It is attached to a form(or
>>> could be attached to the page) and is executed when the form is
>>> processed.
>>> In this way one can do anything they want when a form is submitted
>>> rather
>>> than just validate data... although I suspect that your function is not
>>> that restrictive either?
>>
>> Mine is entirely intended for data validation. You can't reasonably do
>> much more with it because it only operates on a single field -- not the
>> whole form.
>>
>> When the form has been submitted you call:
>>
>> $ok = $form->accept_submission() && $form->validate();
>>
>> then the DBF_Form object will read submitted data and validate each field
>> in turn. Then you can call:
>>
>> $vals = $form->get_values();
>>
>> which returns an array of validated values, and you can do with that what
>> you want (e-mail it, store it in a database, etc).
>>
>> --
>
>
> If you have multiple forms how do you distinguish from them?
oh... I guess you use 1 object for 1 form...
Navigation:
[Reply to this message]
|