Javascript to update subform

Javascript to update subform

Unread postby ruiascensao » Sun Sep 07, 2014 9:11 am

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?
BR
Rui
ruiascensao
 
Posts: 177
Joined: Tue Nov 15, 2011 10:54 pm

Re: Javascript to update subform

Unread postby admin » Thu Sep 18, 2014 8:00 am

rui,

How about this?

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

Steven
admin
Site Admin
 
Posts: 3406
Joined: Mon Jun 15, 2009 9:53 am
nuBuilder Version: 4.5

Re: Javascript to update subform

Unread postby ruiascensao » Tue Sep 23, 2014 4:01 am

Hi Steven,

Thanks!
BR
Rui
ruiascensao
 
Posts: 177
Joined: Tue Nov 15, 2011 10:54 pm

Re: Javascript to update subform

Unread postby admin » Tue Sep 23, 2014 12:48 pm

.
admin
Site Admin
 
Posts: 3406
Joined: Mon Jun 15, 2009 9:53 am
nuBuilder Version: 4.5


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 3 guests