We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Show Error message on UI page

chidanandadhath
Kilo Guru

Hi All,

I want to show a error message in the same dialog window based on condition in clident script UI Page like below

if(condition=='true')

{

<show error message>

}

 

could you please let me know how to achieve this.

 

 

1 ACCEPTED SOLUTION

hvrdhn88
Giga Patron

You can try something like this way. 

 

Define below line in html

 

<span style='color: red;' id="error_msg" class="outputmsg_text"></span>

 

UI Page client side code 

 

if(condition=='true'){

$j('#error_msg').html(getMessage('Could not request without name'));
gel('error_msg').show();
return false;

}	

 

Quick Demo

 

find_real_file.png

 

Reference:

 

https://www.geeksforgeeks.org/how-to-display-error-without-alert-box-using-javascript/

 

If my answer helped you, kindly mark it as correct and helpful.

View solution in original post

4 REPLIES 4

hvrdhn88
Giga Patron

You can try something like this way. 

 

Define below line in html

 

<span style='color: red;' id="error_msg" class="outputmsg_text"></span>

 

UI Page client side code 

 

if(condition=='true'){

$j('#error_msg').html(getMessage('Could not request without name'));
gel('error_msg').show();
return false;

}	

 

Quick Demo

 

find_real_file.png

 

Reference:

 

https://www.geeksforgeeks.org/how-to-display-error-without-alert-box-using-javascript/

 

If my answer helped you, kindly mark it as correct and helpful.

Hi Harshavardhan,

 

Thanks a lot for the reply

 

I gave the condition like below

if(condition=='true')

{

 $j('#error_msg').html(getMessage('Please Enter Scheduled Job Name'));
gel('error_msg').show();
return false;

}

else{

$j('#error_msg').html(getMessage('test));
gel('error_msg').show();
return false;

}

 

the else loop is not executing...only its showing the first one..

missing colon in test .

try

$j('#error_msg').html(getMessage('test'));

Thank you very much