Your problem can be broken down into two parts:
1. How to uniquely identify the button in such a way that you can modify it's enabled state programmatically as required.
One way you can do this is to wrap each of the buttons you need to identify in an HTML element with an ID, and you can use Custom Style markup like the following to do that.
@@#edit-button;<<button "Edit">><</button>>@@
@@#save-button;<<button "Save">><</button>>@@
<<button "Confirm">><</button>>
... which after processing generates HTML elements like the following.
<span id="edit-button">
<button class="link-internal macro-button" type="button" tabindex="0">Edit</button>
</span>
<br>
<span id="save-button">
<button class="link-internal macro-button" type="button" tabindex="0">Save</button>
</span>
<br>
<button class="link-internal macro-button" type="button" tabindex="0">Confirm</button>
... now the Edit button element can be identified via #edit-button button and the Save button element via #save-button button
2. How to modify the state of a button element so that it appears disabled.
In an ideal world you could simple use CSS to alter the the cursor property of button element to not-allowed which would not allow the user to click on it, unfortunately this does not work on mobile-based web-browsers.
So you will need to use Javascript to modify the element's disabled attribute instead, which the following example demonstrates.
@@#edit-button;<<button "Edit">>
<<run $("#edit-button button").attr("disabled", true)>>
<<run $("#save-button button").attr("disabled", false)>>
<</button>>@@
@@#save-button;<<button "Save">>
<<run $("#save-button button").attr("disabled", true)>>
<<run $("#edit-button button").attr("disabled", false)>>
<</button>>@@
<<button "Confirm">><</button>>
... and then uses some CSS like the following in your Story Stylesheet area so that you can tell when the button element is disabled or not.
.passage button:disabled {
opacity: 0.65;
}
Now the only issue left is how to disable the Save button when it is first displayed to the end-user, and one way to do that is to use a single-use postrender task handler to disable the Save button element after it is created but before it is displayed to the end-user. Simple add the following to the end of the Passage that contains the Edit and Save <<button>> macro calls.
<<script>>
postrender["Disable Save Button"] = function (content, taskName) {
delete postrender[taskName];
$(content).find("#save-button button").attr("disabled", true);
};
<</script>>