function MPCheckStoriesForm(thisForm) { with (thisForm) { var errors = new Array(); if (story_text.value == '') errors.push("Please enter your story text before submitting this form."); var filePath = image_file.value; filePath = filePath.split('.'); var fileExt = filePath[filePath.length - 1].toLowerCase(); if (filePath != '' && fileExt != 'jpg' && fileExt != '.jpeg') errors.push("Uploaded file must be in JPEG format (and have a .jpg extension)."); if (!agree_to_terms.checked) errors.push("Please agree to the terms and conditions before submitting this form."); if (hex_md5(mp_security_entry.value) != lastMD5) errors.push("Security code does not match image (case sensitive)."); if (errors.length > 0) { alert(errors.join("\n\n")); return false; } else return true; } }