XUpload - Form validation on submission

Message
Author
nodak
Posts: 14
Joined: Apr 13, 2007 7:01 pm

Form validation on submission

#1 Postby nodak » Apr 13, 2007 7:10 pm

I have built a very customized app for our users and have integrated the xupload script to help with the file uploading.

Everything is working great, except I need to call a javascript I wrote to check the additional fields I'm gathering data from for valid info prior to submitting it for upload.

Since xupload uses the onsubmit call looking for a returned value, I wrote another function to submit the form, first calling my validation script and if it passes, then call the upload script.

Unfortunately it won't execute the upload. I'm looking for some ideas on how to make this work.

The function I'm using to submit the form is:

Code: Select all

<script type="text/javascript" language="JavaScript">
<!--
function OnSubmitCheck() {
var formValid = Validate();
if(formValid == false) { 
	return false; 
}
else {
	StartUpload(this);
}
return true;
}
//-->
</script>
Looking forward to hearing some suggestions. I'm using the pro version of xupload and running on IIS6.

I'm very impressed with the script so far, you've done great work with it. I'm using it to gather data and upload image files through a PHP script and then resize the image files on the server, rename them, AND overlay text from the form.

Without this script I'd still be banging my head against the wall looking for a way for our users to track the file upload progress! :P

nodak
Posts: 14
Joined: Apr 13, 2007 7:01 pm

#2 Postby nodak » Apr 13, 2007 9:10 pm

Well I got it. So no worries!

Thanks again for an excellent script!

Forgot that this means, the form being submitted and changed it to the form name.

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#3 Postby PilgrimX182 » Apr 16, 2007 9:26 am

No problems, good luck there ;)