Spry Validation not Working with Pure PHP Upload 2
I Cannot get the Validation to Work with Pure PHP Upload
Question
I am trying to use Pure PHP Upload 2 and have a spry validation. I cannot get the validation to work.
Answer
The issue is that the Pure PHP Upload onSubmit code is overriding the Spry validation call.
Solution:
Change the Form onsubmit from:
onsubmit="checkFileUpload(this,'',true,'','','','','','','');return document.MM_returnValue"
to:
onsubmit="
if (Spry.Widget.Form.validate(this)) {checkFileUpload(this,'',true,'','','','','','','');return document.MM_returnValue;} else {return false;}"
Basically, it says if
the form is valid, run the upload code, otherwise return false (which
cancels the submit).
Comments
Be the first to write a comment
You must me logged in to write a comment.