January 23, 2018 12:00 AM
I've tried setting the "btn" name to a variable, then ".setAttribute('disabled',"true")", ".removeAttribute('disabled')" and variable.disabled = "true".
Any other thoughts? I've moved the actions around (including at page show, regular show, and onClick) and added a delay.
For some context, I want to set a group of buttons disabled first, then conditionally set one or more of them as enabled based on certain conditions. I was hoping this would make it a ton easier than adding an action group with a set state for every single button.
Update - I can get this to work on a custom div within the onmousedown function, so I wonder if my first hunch is right, in that I can't override Lectora's onmousedown and would have to create a completely custom div to accomplish this.
@JasonADal - you seem to be obsessed by making things much harder and more complex than it needs to be. Just use the built in functionality where it can do what you need. Either by setting the button(s) to be 'Initially disabled' in the button properties or by using the on show function as you describe.
Lectoras native "Set state" action can be used in jQuery:
Ofcourse this is not exactly what you want... you want to directly set some button.
Gonna do some tests to find out if its possible.
@mnotermans5114 - Thanks for taking the time to look at your library. I really think it's unachievable without a series of Custom Divs for the buttons, where I have full control over the onmousedown command.
@mallow76 - I will happily admit to sometimes "making things harder". I'm trying to expand my repertoire and following the status quo, it's less likely that I'll learn and grow as a developer.
It looks like I could also use this for visibility but at the same time, in research noticed that there may be other more efficient ways to change certain attributes.
However, I just don't seem to be calling the code below properly.
Figured it out...
where button40 is the HTML NAME of your button in Lectora.