I'm sorry if this is not the place to do this but I really need the help.
I am creating a form that a user will fill out and save. I have validation set up and more or less working using jquery.validate.
But I was asked to allow the user to be able to save the data they have entered even if it does not pass validation. The use case is that the user does not have all the information at that time and wants to save and come back later. Or they are just lazy and don't want to fill it all in right now. Yeah probably that last one...
I have the form posting the data even if it is not valid by using (took me a while on this one as well)
<script type="text/javascript">
$("form").bind("invalid-form.validate", function () {
$("form").submit();
});
</script>
But what I am failing at is having the validation run when the user comes back, i.e. when the page is loaded for the first time. The validation runs when the user saves and gets the post back. But when it is loaded it does not.
So as an example my form has 5 fields that are all required. When a user opens the form for the first time ever all 5 fields are marked as being required. Auto validation on form load, that is what I am looking for. If say a user enters in a value of 10 in a field and the valid range is 50 -100 and the validation says "HEY, that's wrong" it will still post and save. When the user comes back the next day and they load it up the form shows a value of 10 and it also says "HEY, that's wrong"
Is there any way of doing this? I hope so cause my javascript skill is still very much an infant. If I have to hack this I might be a little screwed.
*Crosses fingers*