Back to Top
The nuts and bolts for
Creative web development

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).

Teodor Kuduschiev

Teodor KuduschievWorking as a Q&A Engineer at Dynamic Zones International BV. Along with the support and the forums, he's taking time to create awesome designs.

See All Postings From Teodor Kuduschiev >>

Share this Article