hi guys,
In classic Form ....
give me the solution of how can i customize this so that it will save other information when i don't want to upload a file.
naveen
hi guys,
In classic Form ....
give me the solution of how can i customize this so that it will save other information when i don't want to upload a file.
naveen
May 26, 2009 - 11:02am
You'll have to modify the site to check for a file and if there is none to just go ahead and submit the form.
June 4, 2009 - 12:28am
i don't understand you. what is your mean??
June 4, 2009 - 9:30am
In the classic form demo every time you change a field it runs a check to see if the form is ready and enables the Submit button. You'll need to modify that routine so it doesn't require a file to be selected.
Then the submit button starts the upload. SWFUpload's uploadComplete handler calls the Form's submit() method causing the form to submit separately.
Then the Thankyou.php page checks for an uploaded file and shows the proper messages.
You are going to have to modify all those parts to submit a form without the file.
The submit button will need to check for a file, if there is one then upload it, otherwise just call the Form's submit() method.
Then you'll need to modify ThankYou.php so if no file was sent it handles that properly.
February 8, 2010 - 9:40am
Here is my solution. I edited so it fits my needs.
Edit function validateform:
---------------------------------------------------------------------------
function validateForm() {
var txtName = document.getElementById("name");
var txtTel = document.getElementById("tel");
var txtEmail = document.getElementById("email");
var txtMsg = document.getElementById("msg");
var isValid = true;
if (txtName.value === "") {
isValid = false;
}
if (txtTel.value === "") {
isValid = false;
}
if (txtEmail.value === "") {
isValid = false;
}
if (txtMsg.value === "") {
isValid = false;
}
document.getElementById("btnSubmit").disabled = !isValid;
}
---------------------------------------------------------------------------
Then edit function doSubmit (wrap the entire thing in the if clause i used and don't forget the 'else'!):
---------------------------------------------------------------------------
function doSubmit(e) {
if (formChecker != null) {
clearInterval(formChecker);
formChecker = null;
}
if (document.getElementById('txtFileName').value != "")
{
e = e || window.event;
if (e.stopPropagation) {
e.stopPropagation();
}
e.cancelBubble = true;
try {
swfu.startUpload();
} catch (ex) {
}
return false;
} else
{
document.forms["contact"].submit();
}
}
---------------------------------------------------------------------------
And then it should work
Greets,
Rdejong3