DMXzone 15th Anniversary Sale! Use promo code: DMX15YEARS for at least 30% discount
Spry Validation not Working with Pure PHP Upload 2
April 3, 2012 by Teodor Kuduschiev

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

Place your comment about Spry Validation not Working with Pure PHP Upload 2




You must me logged in to write a comment
Comments

Be the first to place a comment