Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

check on print criteria

Locked
Henk_2a
Posts: 52
Joined: Sun Feb 14, 2016 8:42 pm
Location: Nederland

check on print criteria

Unread post 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!
admin
Site Admin
Posts: 2789
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 4 times

Re: check on print criteria

Unread post 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
Henk_2a
Posts: 52
Joined: Sun Feb 14, 2016 8:42 pm
Location: Nederland

Re: check on print criteria

Unread post by Henk_2a »

excellent, I made it, thanks !!!
admin
Site Admin
Posts: 2789
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 4 times

Re: check on print criteria

Unread post by admin »

.
Locked