javascript - Unable to form JSON string object from the values of textfields in add/remove textfields -


i have done add/remove textfields using jquery. i'm not able form json string values of textfield in interface on form submit.
below fiddle. want form json string on form submit. json of format :

{"datalist":["thanks calling us","please select following list"]}   

how can it

your fiddle has several problems

you have no form element, code: $("form").submit( nothing there no form element select

the other problem have no element id of #welcome_notes code:

$( '#welcome_notes input[id^=ivrgroupzbase_grpzwelcomenotes]' ).serializearray() 

amounts nothing there no element #welcome_notes select inputs , serialize

the last problem element have id ivrgroupzbase_grpzwelcomenotes div element not input element doing:

$("#ivrgroupzbase_grpzwelcomenotes").val(json); 

has no effect because not input element , not have value. create input (type=hidden if want hidden) , give unique id , use set json value to.

jsfiddle demo


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -