I had the following code that would create a javascript confirmation page. This code lived inside a form which wouldn't submit until the user clicked the Ok button.
- <input type="image" onclick="return confirm('You will not be able to change your answers if you submit now.\nAre you sure you want to submit this test?');" name="SubmitTestButton" src="images/submit_test.jpg" value="Submit Test" class="submit_test_button" />
I've bee trying to achieve the same effect using CFWINDOW. Only, once the window comes up the form automatically submits.
Current code:
- <form name="TestForm" [...]>
-
[OTHER CODE]
-
-
<p><input type="image" onclick="ColdFusion.Window.show('submitTest')" name="SubmitTestButton" src="images/submit_test.jpg" value="Submit Test" class="submit_test_button" /></p>
-
</cfif>
-
</form>
-
-
<cfwindow name="submitTest"
-
center="true"
-
closable="true"
-
draggable="false"
-
height="200"
-
width="200"
-
initShow="false"
-
modal="true"
-
refreshOnShow="false"
-
resizable="false">
-
<cfoutput>
-
<p>You will not be able to change your answers if you submit now. </p><p>Are you sure you want to submit this test?</p>
-
<input type="image" name="SubmitTestButton" src="images/submit_test.jpg" value="Yes, Please Sumbit" class="submit_test_button" /></p>
-
-
</cfoutput>
-
</cfwindow>
I've been trying to figure out a way to create a coldfusion confirmation box, essentially. Any help or direction will be appreciated. I will post back the final code for reference.