Page 2 of 2

Re: nuPrompt() Insert into Field?

Posted: Wed Sep 15, 2021 11:01 am
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.

Re: nuPrompt() Insert into Field?

Posted: Wed Sep 15, 2021 11:16 am
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');