I have two buttons. The second button can’t be pressed until the first button has already been pressed. So, I’ve created a variable ‘varEnableButton’ with a value of 0. Then, as part of the action on the first button I change the value to 1. I then have a dynamic attribute of Disabled on the second button with the value being varEnableButton == 0. It works perfectly - it’s disabled on page load and then becomes enabled after the first button is clicked.
But, the rest of the action on the second button fails because the variables don’t seem to be accessible anymore. I had a Data Detail containing an ID and use this in the action of the second button. But, that GET variable isn’t there when I click the button (browser console confirms this). If I remove the Disabled attribute then it works perfectly.
Is this a bug? Do I need to go about it a different way?
It’s not really related. The generated list has a button on each row to open the modal which then shows the details of that record (it sets the value for the Data Detail). It’s that modal which has two buttons on it. I just want the second button to be disabled until the first button has been clicked.
Strange, do you see any errors in the console? I just tested this locally and it seems to properly pass the data detail value to the load server action event.
I get a 500 error because the server connect script requires the invoiceid to be passed to it. It shows emailInvoice.php as the script that’s called. If I remove the ‘disabled’ dynamic attribute then it correctly calls emailInvoice.php?invoiceid=123 and then works perfectly.
Ooh, you’ve nailed it. I seemed to have a rogue Data Detail set in the click action which reset it back to empty. Doh! Not sure why removing the ‘Disabled’ action resolved it previously but all is now working.