Enable/Disable Properties using javascript

I would like to make a function using javascript where after a single click in checkbox, it will disabled it and proceed to perform the OnChange function, then it will enable the checkbox.



Solution

Hi Gerald Emmanuel Malaca,

No need to create funtion here -

use simple in run javascrpit action.

 document.getElementById("myCheck").disabled = true;

document.getElementById("myCheck").disabled = false;


Regards

Rahul Sahu

Solution

Hello Gerald.

Take a look at a similar discussion where you can see several alternatives. Long story short: better do the disable javascript on the button and the enable on the action.

https://www.outsystems.com/forums/discussion/47929/how-to-disable-button-after-single-click-in-outsystems/


Rahul Sahu wrote:

Hi Gerald Emmanuel Malaca,

No need to create funtion here -

use simple in run javascrpit action.

 document.getElementById("myCheck").disabled = true;

document.getElementById("myCheck").disabled = false;


Regards

Rahul Sahu

Hi sir,

this is the script that I modified based on your answer, but It still doesn't work

SyntaxEditor Code Snippet

"document.getElementById('" + CardTypeInclusionCheckBox.Id + "').disabled=false;" 


Gerald Emmanuel Malaca wrote:

Rahul Sahu wrote:

Hi Gerald Emmanuel Malaca,

No need to create funtion here -

use simple in run javascrpit action.

 document.getElementById("myCheck").disabled = true;

document.getElementById("myCheck").disabled = false;


Regards

Rahul Sahu

Hi sir,

this is the script that I modified based on your answer, but It still doesn't work

SyntaxEditor Code Snippet

"document.getElementById('" + CardTypeInclusionCheckBox.Id + "').disabled=false;" 


Hi

Can you share oml.

what error you get or checkbox is not disabled or not after onchange function


Regards

Rahul Sahu

Rahul Sahu wrote:

Gerald Emmanuel Malaca wrote:

Rahul Sahu wrote:

Hi Gerald Emmanuel Malaca,

No need to create funtion here -

use simple in run javascrpit action.

 document.getElementById("myCheck").disabled = true;

document.getElementById("myCheck").disabled = false;


Regards

Rahul Sahu

Hi sir,

this is the script that I modified based on your answer, but It still doesn't work

SyntaxEditor Code Snippet

"document.getElementById('" + CardTypeInclusionCheckBox.Id + "').disabled=false;" 


Hi

Can you share oml.

what error you get or checkbox is not disabled or not after onchange function


Regards

Rahul Sahu

Hi Sir,


Apologies, I tried it again and solve it was finally with the script I provided, I added a single quotation to solve it


and I used the the extended properties for the disabling  



Thank you 

Great. 

Yeh thats is another way to use Javascript.


Glad to help you


Regards

Rahul Sahu