문제

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?

도움이 되었습니까?

해결책

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top