How is your experience with the OutSystems Community?
52
Views
4
Comments
Solved
Link - Confirmation only if Javascript variable = true
Question

Hi to all,


I work with links. In the On Click Function, we have Ajax Submit Method.

I want use validation only if javascript variable is true.

¿How can do it?

If (isModified) {

Validation

}

Thanks to all.

2019-09-30 07-35-56
Aurelio Junior
Solution

Hi Alberto,

Here's another approach: leave the "Confirmation Message" property empty and use this in the link's extended properties:

"if (showMessage) { if (!confirm('Do you really want to delete this?')) { return false; } }"

2023-07-28 17-00-32
Marco Arede
 
MVP

Hi Alberto De Vargas,

You can run javascript action in a screen flow, to validate what you need, then in case your condition is valid execute the action you need.

Take this document as a reference:

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/JavaScript/Extend_Your_Web_Application_Using_JavaScript/Define_and_Run_JavaScript_Code

Regards,

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi,


You can do this:

It's this that you need?

Hope this can help! ;)


Best regards,

Ricardo

UserImage.jpg
Alberto De Vargas

Ricardo Pereira wrote:

Hi,


You can do this:

It's this that you need?

Hope this can help! ;)


Best regards,

Ricardo

Hi Ricardo,

I need check Javascript Variable, not LocalVariable .


Thanks


2019-09-30 07-35-56
Aurelio Junior
Solution

Hi Alberto,

Here's another approach: leave the "Confirmation Message" property empty and use this in the link's extended properties:

"if (showMessage) { if (!confirm('Do you really want to delete this?')) { return false; } }"

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.