stewartalan
Programmer
I have a form that is sent to a javascript function that first determines if a file has been selected to upload along with it. If there is a file the form is sent to one page with a multipart/form-data enctype and if there is no file then it is sent elswhere witout this enctype.
My Function is thus
function filechecker() {
if (document.FormName.file.value == ""
{
document.FormName.action = "page1.asp";
document.FormName.encoding = "text/html";
document.FormName.method = "POST"
}else{
document.FormName.action = "page2.asp";
document.FormName.encoding = "multipart/form-data";
document.FormName.method = "POST"
}
document.FormName.submit();
}
This does not work and I get a javascript error when trying to submit the form that says 'Could not get the encoding property. Invalid Arguement'
Can anyone tell me where I am going wrong??
Thanks
Stewart
My Function is thus
function filechecker() {
if (document.FormName.file.value == ""
{
document.FormName.action = "page1.asp";
document.FormName.encoding = "text/html";
document.FormName.method = "POST"
}else{
document.FormName.action = "page2.asp";
document.FormName.encoding = "multipart/form-data";
document.FormName.method = "POST"
}
document.FormName.submit();
}
This does not work and I get a javascript error when trying to submit the form that says 'Could not get the encoding property. Invalid Arguement'
Can anyone tell me where I am going wrong??
Thanks
Stewart