Answered
Javascript submit() function
Ok, I've been working on this all day and I hoping someone can help me.
The alerts work correctly, but the form never submits. I've tried changing the cfinputs to read submit versus button. When I do that, it blows by the JS alerts and submits the page. I need the alerts to appear BEFORE submitting the page.
<cfform name="LINAdmin" method="post" action="prereqBranch.cfm" format="flash">
<cfformitem type="script">
function submitButton(type) {
if (type == "Transition LIN") {
if (resultsGrid.selectedItem.lin == undefined) {
alert("You must select a LIN to transition.");
return false;
} else {
alert("Before you can mark a LIN for transition, you must complete the following form.");
LINAdmin.Submit();}
}
}
</cfformitem>
<cfformgroup type="horizontal" style="horizontalAlign:center;">
<cfinput type="button" name="branch" value="Transition LIN" onClick="submitButton('Transition LIN')">
<cfinput type="button" name="branch2" value="LIN Remains" onClick="submitButton('LIN Remains')">
</cfformgroup>
</cfform>
THANK YOU!
Jennifer
