Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 10-24-2011, 12:33 AM   #1
ncjbhd
Registered User
 
Join Date: Jul 2011
Posts: 262
PHP Objects in Forms

I'm using object-oriented PHP for my forms now, because it seems to make sense. Every form field can be customized -- it can render itself to a certain length and type, it can validate itself to specific criteria (date, email, text, etc..), and it can throw its own error message.

What I'm wondering is, when a form is submitted, I just want to have all the $field objects validate themselves and return errors if need be. Is there a way to tell PHP to grab all the $field objects on the page? Or do I have to do something like throw all my field objects into an array and loop through it?

Seems like an unnecessary extra step, but I just want to make sure I'm doing this right.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ncjbhd is offline   Reply With Quote

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importance of Php Development for Web Development tech.biztech Programming General 35 11-22-2019 12:37 AM


All times are GMT -7. The time now is 08:17 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.