I've been toying around with form handling via Sessions variables containing objects.
Most forms, at least ones that allow you to review your data before confirming it, is at least a 3 step process.
Form Process:
1. Present Blank form.
2-A. Accept user input. Validate. If there is a problem, display error and form again prefilled with the data that is correct.
2-B. Accept user input. Validate. If everything is correct, display data for user to confirm that what they entered is what they really want.
3. User confirms data. Data is handled. User is presented with confirmation.
Previously, in step 2-B, I would use hidden form fields to pass the data along to the last confirmation page. This is because when I display data on the page for user's to review, I would not use form fields for the display. I think it easier for users to spot errors when the data is displayed as simple text rather than text in text fields, radio buttons, checkboxes, drop-down menus, etc.
Since I already use objects to (temporarily)house all my data in applications. I figured, if I was already storing the data in objects, why not just throw that object into a session variable rather than getting all the data out of the objects and placing it into hidden fields in the form. Then putting it all back into the objects on the subsequent pages.
What is everyone's opinion on this? Good? Bad? Indifferent?
I am the only programmer in the company I work for. This is both great and terrible at the same time. It's great because as long as the applications work, my bosses can't complain because they really have no idea how it is I do what I do. It's horrible because I don't have someone else to turn to when I'm stuck. But even worse than that, I don't have anyone that can periodically review my code and give me ideas on how to better code. I'm totally dependant on my own experience and reading about/reviewing code from others online. So what do you think?
Forms via SESSIONS and Objects.
Moderator: General Moderators