Welcome Guest, Not a member yet? Register   Sign In
What are your preferences with forms?
#1

[eluser]simshaun[/eluser]
In the past, I always had separate forms for Adding and Editing something. In many instances, I have additional or different fields on the Edit form.

Now I've got a third form to throw into the loop. Its becoming a pain in the butt to simply add an additional field, having to modify all 3 forms in up to 3 spots per form.

Do you prefer having a single form with conditions for "Edit" specific fields, or do you prefer having separate forms for each action? I can see advantages and disadvantages to both methods, so what are your opinions?
#2

[eluser]Jondolar[/eluser]
Some forms that I create for adding have additional fields that don't transition to editing. For example, I have a form to add a new product. When you add the product, you can upload an initial picture of the product. When I add the product record, i also create the different sizes of the picture and add it to the picture table. When the user edits the product, they don't have an opportunity to edit the picture. They must go to another screen to manage pictures (such as uploading more for this product, modifying titles, deleting, etc). In those cases, it would take some extra code to hide various form elements, etc.

However, many screens such as adding/editing states/countries have exactly the same layout of the form. The only difference is the hidden form field for the record id and then the logic to process the form differently. Still, to this day, I use separate files/forms. Once I create the "add" page, I then save it as an "edit" page and then modify it. I've not found it too difficult to do. When I add a new field to an existing "add" form, I just copy/paste that to the "edit" form, echo the variable to the value"" attribute and that's it.

So, my opinion...
I'd like to be able to take advantage of using just one form but I don't have a way to do it that works for me. Once I see one and experiment with it, I'll know if I would start using that technique.




Theme © iAndrew 2016 - Forum software by © MyBB