Error alert in pop up model box for Nintex form


Badge +5

Hello All,

i have a nintex form , which contain some fields. In that fields "attachment field" is a mandatory  field. i able to make a attachment field is mandatory, but i'm unable to  make alert message in pop up model box , when ever user Submitting a form with attachment.

Colud you please help me out.

Thanks,

Santhosh.


6 replies

Userlevel 5
Badge +14

how do you ensure attachment mandatory-ness? by a rule or javascript or ...?

Badge +5

Hi Marian,

Using by Rule isNullOrEmpty({ItemProperty:Attachments});

Is there any way to get a error message in pop up.

Thanks,

Santhosh

Userlevel 5
Badge +14

you can do it eg. following way:

add following at the end of your rule:  && myAlert("field is empty")

and add following custom javascript code into form's settings:

function myAlert(txt){

  alert(txt);

  return true;

}

Badge +5

Hi Marian,

Working ,But the problem is now the form is not submitting, keep getting a alert , when ever i click a save button  , even if i attach a file also.

Regards,
Santhosh.

Badge +5

Hi Marian ,

The code is working fine .

1) first i added this rule " isNullOrEmpty({ItemProperty:Attachments}) && myAlert("Please Attach the file") " into Attachment filed rule place.

2) Then i added the  below code in nintex form seetings under custom javascript field.

function myAlert(txt){

  alert(txt);

  return true;

}

It is validating and giving pop up but , even if i Attach file  also, the form is not submitting . below i attached Screen shot please find  out.

Capture.PNG

Help me out with the solution.

Thanks,

Santhosh.

Userlevel 5
Badge +14

I havn't noticed that but problem is in your condition. since you've written the condition is working for you I haven't checked it through.

problem with it is that you check item's property and it gets populated just after you submit the form. all the validation rules (especially in new form/mode) should be based on named controls and not on item properties

have a look here for a better way how to ensure attachment is added to the form

https://community.nintex.com/message/42747#comment-42747

Reply