I have page_a.cfm and page_b.cfm. On first page(page_a.cfm) a I have a cfinput (type submit) button that when is clicked it redirects you to page_b.cfm where some queries are run. On this page there is also a button (called "Back") that send you back to page_a. I want the text of the button on page_a.cfm to change based on some condition on page_b.cfm so when I click the "back" button on page_b.cfm and send me back to page_a.cfm the button's text had changed.
On page_a.cfm I have this:
<cfform action="page_b.cfm">
<cfinput type="Submit" name="multiring_btn" class = "multiringButton"
value="ACTIVATE after hours voicemail"/>
</cfform>
On page_b.cfm I have this:
<cfif someConditions = true>
Successfully changed
<cfelse>
An error has occurred!
</cfif>
<cfform action="page_a.cfm">
<cfinput type="submit" name="back_btn" value="Back">
</cfform>
<script type="text/javascript">
function toggleText(multiringButton) {
var text = document.getElementById(multiringButton).firstChild;
text.data = text.data == "ACTIVATE after hours voicemail" ? "DEACTIVATE after hours voicemail" : "ACTIVATE after hours voicemail"; }
</script>
However when I click the button "back" the text of the button on page_a.cfm is still the same.