jquery - Serialize form, where fields have multiple child fields -


i have 1 form has 4 fields:

  1. full name
  2. email
  3. text area
  4. address

full name , address have multiple fields.

i have 4 columns in database: full name, e-mail, text area, , address.

can let me know how achieve result?

here form layout:

form layout

if constrained 4 fields in database can concatenate 2 fields known delimiter like

assuming

fname = $('#fname').val(); lname = $('#lname').val(); 

then

delimiter = "~"; fullname = fname  + delimiter + lname; 

and same address

then when read fields form edit can use split on delimiter break them up

name = fullname.split(delimiter); fname = name[0]; lname = name[1]; 

however better solution add more fields database table accommodate individual fields


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -