Page 1 of 1

Javascript to update subform

Posted: Sun Sep 07, 2014 1:41 am
by ruiascensao
Hi ,

I have a form that when user updates the status it should insert a new line in the Jobhistory_subform.

Code: Select all

function updatehisto() {
    //Place the field data-prefixe that are marked for deletion in an array.
    var subFormPrefixes = nuSubformArray('jobhistory_subform', true);
//Update the job status
    var newValue = $('#jobstatuschange').val();
    $('#job_status').val(newValue);
//Place a new line in the subform "jobhistory_subform" .
    for( var index in subFormPrefixes) {
        if($('#'+subFormPrefixes[index]+'jobhistory_visaid').val()==' '){
           $('#'+subFormPrefixes[index]).checked=false;
           $('#'+subFormPrefixes[index]+'jobhistory_visaid').val(newValue);
 }
} 
nuSaveForm();
}
At the moment I'm able to "//Update the job status" but I'm not able to "//Place a new line in the subform "jobhistory_subform" ."

Could you please advise?

Re: Javascript to update subform

Posted: Thu Sep 18, 2014 12:30 am
by admin
rui,

How about this?

In the lastest build I have added a function nuAddRow(subformname) that should help.

Steven

Re: Javascript to update subform

Posted: Mon Sep 22, 2014 8:31 pm
by ruiascensao
Hi Steven,

Thanks!

Re: Javascript to update subform

Posted: Tue Sep 23, 2014 5:18 am
by admin
.