Question

I am using 12 hidden-fields on a form to store some values that I need to persist along my AJAX posts to the server.

Is this a bad practice? Should I use another technique like storing a JSON string inside just one hidden field? Or it's common scenario having all this hidden fields?

Was it helpful?

Solution

Ultimately there is nothing wrong with having 12 hidden fields on a form. It's hard to give advice on what you should do because I do not know your circumstances.

My only piece of advice in these situations is to evaluate the situation and examine what your application is doing and if there is a better way.

Ask yourself if a form is doing too much at once. Can it be divided up? Is there a way to simplify the task at hand?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top