So I want to validate my form using jQuery, this is how I imagine it and it works, but is the best method of doing it and maybe I can do it more effective with less code?
<script type="text/javascript">
$(document).ready(function()
{
$("#frmCatAdd").submit(function()
{
var name = $("#edtName").val();
if (name == "")
$("#edtName").css("border", "1px solid red")
else
$("#frmCatAdd").submit();
return false;
});
});
</script>
Try looking at jValidate in order to simplify and speed up your task. I use it as routinely as creating new forms.
However, I strongly recommend you validate on server side as well. All the user has to do is turn off Javascript to defeat your perfect validation rules.