Posted Tutorial, plus a requirement
Posted: Wed Oct 28, 2015 3:58 am
Hello,
I followed the example of the video that shows making invoices posted, which hides the save button, and enters a 1 into the posted field on the invoice table.
What I would like to do is the same thing, except I do not want the user to be able to post the record until another column is a specific value.
I tried piecing together before save and save form with the following in the extra button tab, JavaScript code box:
// not in code.. 1sta_satatus is the field to be checked
// not in code.. "Complete" is the value that has to be used (also tried the direct field on the main table and it's related foreign key)
// not in code.. 1tic_posted is the field to mark as 1.
var data = $('#1sta_status').val();
if(data = "Complete"){
$('#1tic_posted').val(1);
$('#1tic_posted').change();
nuSaveForm();
}
any hints?
I followed the example of the video that shows making invoices posted, which hides the save button, and enters a 1 into the posted field on the invoice table.
What I would like to do is the same thing, except I do not want the user to be able to post the record until another column is a specific value.
I tried piecing together before save and save form with the following in the extra button tab, JavaScript code box:
// not in code.. 1sta_satatus is the field to be checked
// not in code.. "Complete" is the value that has to be used (also tried the direct field on the main table and it's related foreign key)
// not in code.. 1tic_posted is the field to mark as 1.
var data = $('#1sta_status').val();
if(data = "Complete"){
$('#1tic_posted').val(1);
$('#1tic_posted').change();
nuSaveForm();
}
any hints?