Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

nuPrompt() Insert into Field?

Questions related to customising nuBuilder Forte with JavaScript or PHP.
pmjd
Posts: 132
Joined: Fri Mar 12, 2021 10:38 am
Has thanked: 3 times
Been thanked: 1 time

Re: nuPrompt() Insert into Field?

Unread post by pmjd »

Fantastic! Working now as hoped.

The only other question i have, is there a way to make sure tex is written in the nuPrompt box, so it can't be left blank?

No worries if not.
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: nuPrompt() Insert into Field?

Unread post by kev1n »

Check if the value is blank and show nuPrompt again.

Code: Select all

function nuOnPromptClose(val, ok) {  
   if (ok) {
        if (val.trim() == '') {
           nuMessage('***someting*** cannot be left blank')
           setTimeout(function(){ nuPrompt('someting', 'caption'); }, 200);
        }
        nuSetValue('mpd_reason', val);
        nuDisable('mpd_status')
    } else {
        nuSetValue('mpd_status', status);
    }
}



nuPrompt('someting', 'caption');
Post Reply