Error Checking Forms and DW-MX/PHP

I’m working my way through a small task, namely getting some information from a form and storing that information in the database. After many hours I have got this to work thanks to some kind help from the people on this forum.

I now need to add some error checking to the form, my first thought was to simply use DW-MX behaviours. I only have a few fields that need to be error checked, the rest are just drop down menus.

Anyway at the moment I simply check to see if the user has clicked the submit button and then process the form. If I add a DW Behavior will this cause problems?

I’m thinking in terms of a user entering some incorrect data, the behavior kicking in when they press the submit button and telling them about the error. In the meantime the php code will recognise that the submit button has been clicked and process the incorrect form anyway.

I use the following code on the form:

<form name="form1" method="post" action="<?php echo($PHP_SELF) ?>">
 <input name="Submit" type="submit" id="Submit" value="AddMe">

I use the following code to process the form:

if($HTTP_POST_VARS['Submit']=="AddMe")   {     Add Form Information Code  }

Will I be able to use DW-MX Behaviours for error checking or will they cause the problem I said?