I needed to disable the submit button in a dialog component to prevent the user from submitting the same form twice. I searched this forum and could not find a simple example of this procedure so others might find this useful. There might be better ways but this does work.
I kept the original submit button but reduced its size to 0 so the user can not click it and I added a new submit button with javascript. The new button calls the original submit process and the new button is disabled. The normal submission takes place including the after validate process. I am including in the example a second button as an example of allowing the user to exit with out the submission.
In the dialog component (named rm_repdaterng) the original submit button is named submitButton which I found by examining the source of the web page before my changes.
Has submit button = yes
Submit button in line style = height: 0px; width: 0px; border-style: none;
Submit button label = ""
In after validate
currentform.RedirectTarget = [your target]
In freeform below the dialog
<div align=right>
<input type="button" onClick="location.href='adminreps.a5w'" value="Return to Administrative Reports" style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BACKGROUND-COLOR: #f9ead6; BORDER-TOP: 1px solid; BORDER-RIGHT: 1px solid">
<input type="button" value="Submit" onClick="document.forms['rm_repdaterng'].submitButton.click();this.disabled = true" style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BACKGROUND-COLOR: #f9ead6; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid"></div>
I hope this is useful and I want to thank all of you for your help in this forum.
Irwin
I kept the original submit button but reduced its size to 0 so the user can not click it and I added a new submit button with javascript. The new button calls the original submit process and the new button is disabled. The normal submission takes place including the after validate process. I am including in the example a second button as an example of allowing the user to exit with out the submission.
In the dialog component (named rm_repdaterng) the original submit button is named submitButton which I found by examining the source of the web page before my changes.
Has submit button = yes
Submit button in line style = height: 0px; width: 0px; border-style: none;
Submit button label = ""
In after validate
currentform.RedirectTarget = [your target]
In freeform below the dialog
<div align=right>
<input type="button" onClick="location.href='adminreps.a5w'" value="Return to Administrative Reports" style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BACKGROUND-COLOR: #f9ead6; BORDER-TOP: 1px solid; BORDER-RIGHT: 1px solid">
<input type="button" value="Submit" onClick="document.forms['rm_repdaterng'].submitButton.click();this.disabled = true" style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BACKGROUND-COLOR: #f9ead6; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid"></div>
I hope this is useful and I want to thank all of you for your help in this forum.
Irwin