Page 1 of 1

check on print criteria

Posted: Thu Feb 25, 2016 9:35 pm
by Henk_2a
I am understanding nuBuilder more and more and I am really enjoying it.

However, there are issues.

I have made a report with a criteria-form, a special form with two date-selections, a beginning date and an ending date. Now I have to check these dates, are they NULL, is the enddate earlier than the beginningdate etc.
I tried to use a custom-code field for that checks but it looks like these codes are all neglected in a print-criteria-form. Actually, what I am looking for is a "before print" custom-code, but that isn't there.
Of course i tried PHP, but I dont know how to notify the user from mistakes. Any output appears on a second, blank screen and the print stops because "I have already sent output"
If I use a criteria form, where can I check that code? and how can I inform the user of his mistakes?

Thanks for your answer!

Re: check on print criteria

Posted: Fri Feb 26, 2016 3:26 am
by admin
Henk_2a,

Try something along the lines of this in the JavaScript section of the criteria Form..

Code: Select all



function bob(){
    
    var q   = 1;
    if(q == 1){
        alert('You filled it out wrong..');
        return false;
    }else{
        return true;
    }
    
}


var c   = $('#nuButton0').attr('onclick');


$('#nuButton0').attr('onclick','if(bob()){' + c + ';}')

Steven

Re: check on print criteria

Posted: Fri Feb 26, 2016 7:16 pm
by Henk_2a
excellent, I made it, thanks !!!

Re: check on print criteria

Posted: Thu Mar 17, 2016 4:56 am
by admin
.