Image

Imagepatchwolf wrote in Imagephp

I've got a problem integrating php and javascript (strictly for validation purposes), and I'm hoping someone here can help.

I'm using the TMT Validator (found here: http://www.massimocorner.com/validator/) on this form, but while the validator works like a charm, it stuffs up the form submission on the page.

When I click submit (and have valid data), the page simply reloads, and the IF conditional I have below does not run. If I remove the tmt:validate="true" section, the script runs normally.

Any help?


<form method="post" action="<?=$_SERVER['PHP_SELF'];?>" tmt:validate="true">
<table>
    <tbody>
        <tr>
            <td style="width: 30%;"><label for="text1">Text1:</label></td>
            <td><input name="text1" type="text" value=""
            tmt:required="true"
            tmt:errorClass="error"
            tmt:message="Text1 ERROR: You must enter a value." ></td>

            <td id="t_err" style="width: 30%;"></td>
        </tr>
    </tbody>
</table>
<br /><br />
<input type="submit" value="Submit" name="submit" />
</form>

<hr />


<?php

if (isset($_POST['submit'])) {
    print (
"<p>Text1 Value: ".$_POST['text1']."</p>");
}

?>