Hi,
I want save multiple individual records for a single model. So my form will have <input>
elements with IDs that look like this Author0Title
; Author1Title
; Author2Title
, etc.
I will be getting values for these input's using jQuery.getJSON()
method.
I want to assign individual values for these input like these automatically.
document.getElementById('Author0Title').value = respose.data[0].title;
something like..
for(i=0;i<response.data.length; i++){
var id = 'Author' + i + 'Title';
document.getElementById(id).value = respose.data[0].title;
}
But it is not working. I appreciate any help.
Thanks.