1

Hi having a problem with this code even if i clicked on cancel it will still proceed to use the action of my form even though the CANCEL button is not part of the form, Would appreciate any help.

Here is the code.

      <form method="post" action="input_enroll.php" >
            <div id="overlay1">

                <div>
                    <h1> Enter Educational Level Entry</h1>
                <input type="text" name="level" >
            <input type="submit"   value="Proceed To Enroll" '>
                    </form>
                <input type="submit"   value="Cancel" onclick='overlay()'>
                </div>
            </div>

EDIT: Any suggestions what would be a better idea? I'm thinking putting the cancel outside the div.

Anton
  • 429
  • 4
  • 17
  • Once submitted and the HTTP process is starting the only way you can cancel is restating apache, let scripts finish or a timeout. – Mihai Iorga Sep 16 '12 at 09:53

1 Answers1

1

You are having form started, then divs started, then form closed..start form after divs..

as your markup is not correct, browsers will change it as thier parser suggest,

In chrome </form> tag is postponed after </div>s..

        <div id="overlay1">
            <div>
            <form method="post" action="input_enroll.php" >
                <h1> Enter Educational Level Entry</h1>
                <input type="text" name="level" />
                <input type="submit"   value="Proceed To Enroll" />
            </form>
            <input type="submit" value="Cancel" onclick='overlay()' />
            </div>
        </div>
Rajat Singhal
  • 11,234
  • 5
  • 38
  • 56