Take a look at this fiddle.
Click the edit button and then the add sign(plus icon)…a new input is added,look closer at the value of it’s name attribute.The reason for being like that is for serializing the specific input(and other inputs that might be added)…after serialization.ajax request sent I choose to change the name attr value to the form you see in the other (filled)inputs(code not shown).
Imagine this now:the user clicks edit and goes to modify the name of the existing services…so this content must be saved/serialized again.With the name attribute values being the way they are serialization cannot proceed…what can I do in such a case.
Various thoughts come in my mind…but I want to hear what you have to say.
Modifying again the values(to a serilaization-friendly format) is one choice…
I am afraid that this will not work either…consider this:
As we said the plan is that the name value must be in this form:form…suppose that the user goes to add a service…there are already 3-4 registered…then what will happen is that ALL of the services will be serialized…while only the newly added must.
I have some alternatives in my mind but if you want comment the above…
I wouldn’t make a distinction between new service, edited service and not edited service … at least when you present them in the same view (which implies that you can add/edit/delete services at will). The most I’d do is disabling form elements (as described above).