1423
Views
2
Comments
Enable or Disable Button
Question

What's the better way to enable or disable button based on another input value and without going to server?

I tried an boolean expression on Enabled property of button, but doesn't work. I want that property changing runtime without going to server.

2018-08-06 13-40-17
Ramakrushnarao Seera

Hi Willian,

You can use "RunJavascript" Action which outsystems provides with product. In side that you can write your own java script to enable and disable like below.

 (Or)

you can write java script where ever you want. Please check attached oml file to get more idea..

Syntax Code Snippet

$('#"+ button.Id+"').attr('disabled', true); // to disable
$('#"+ button.Id+"').attr('disabled', false); // to enable


Thanks

Ram


JavaScriptWebDemo.oml
2020-05-29 14-07-58
Rajendra Singh

Hi  willian,

                 You can write the java script in the extended property of of the button or use the run java script action.



Thanks

Rajendra Singh

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