|
You need to attach something to the onClick event of the button, i.e. your validation function. If the validation fails, the function should return False and then the form won't get submitted.
An easier way is to switch to ASP.NET and use validation controls. They will handle both server and client side validation for you, and will make sure that if JavaScript isn't available on the client, that validation still occures on the server. It's as easy as:
<asp:RequiredFieldValidator id="rfvName" runat="server" ControlToValidate="txtName" ErrorMessage="*" Display="Dynamic" />
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Please login or register to view this content. Registration is FREE | Please login or register to view this content. Registration is FREE
Last edited by Minaki; 12-05-2005 at 08:20 AM..
|