OK, generally speaking, instead of duplicating the submit code you can declare a variable at the start of the code, set it as false, and then set it as true in all of the conditions where you want the file to be submitted finally. Then at the end of the code you submit the form if that variable is true. So something like this: var submit = false; if (condition1) { submit = true; } else if (condition2) { submit = true; } else if (condition3) { // ... } else if (condition4) { // ... } else { // ... } if (submit) { var m = this.getField("ad_desc"); var mysubject = m.value + " - Request Form Submission"; this.mailDoc(true, "requestforms@ducjvh.com", "", "", mysubject); } So in this scenario the file will be submitted only if conditions 1 or 2 were true. Hope that makes sense...
... View more