Validation and Impromptu plugins
I'm using jQuery Validation plugin for a upload form, and while the file it is uploaded i must display a message, so i have choosed Impromtu plugin to do this.
The validation code for the form is:
-
<script type="text/javascript">
$().ready(function() {
$("#form_upload").validate({
rules: {
file_artist: "required",
file_title: "required",
file_upload: "required",
category: "required",
subcategory: "required"
},//rules
messages: {
file_artist: " - Please enter the artist!",
file_title: " - Please enter the title!",
file_upload: " - Please select a file to upload!",
category: " - Please select a category for the song!",
subcategory: " - Please select a sub-category for the song!"
}//messages
}); //form validate
}); //function
</script>
And the message box code is attached to the submit button:
-
<input class="submit" type="submit" name="upload_now" value="Upload File" onclick="$.prompt('Uploading, please wait...');" />
Both scripts are working great. But i would like that "Uploading..." notice to apear only if the validation is ok, because now it shows even if the required fields are blank.
I guess that i must use SubmitHandler in Validation script, but it beats be how.
For the last 4 hours i have searched some ways, but i simply don't understand javascript, so please give me a hand.