nuPrompt() Insert into Field?

Questions related to customising nuBuilder Forte with JavaScript or PHP.

Re: nuPrompt() Insert into Field?

Unread postby pmjd » Wed Sep 15, 2021 6:31 pm

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.
Posts: 97
Joined: Fri Mar 12, 2021 7:08 pm
nuBuilder Version: 4.5

Re: nuPrompt() Insert into Field?

Unread postby kev1n » Wed Sep 15, 2021 6:46 pm

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);
    } else {
        nuSetValue('mpd_status', status);

nuPrompt('someting', 'caption');
nuBuilder Team
Posts: 2057
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 8 guests