* eMail: fix misbehavior regarding the unwanted sending of a mail with no subject (despite the warning was given)

This commit is contained in:
Klaus Leithoff 2012-10-29 16:22:15 +00:00
parent c6372b0f49
commit b86a150c97

View File

@ -759,14 +759,28 @@ function fm_blink_currentInputField() {
function fm_compose_sendEMail() {
var addressTable = document.getElementById('addressRows').rows;
var addressSet = false;
var subjectSet = true;
var doubleCheck = false;
for (i=0; i<addressTable.length; i++) {
if(addressTable.item(i).cells[2].firstChild.value != '') {
addressSet = true;
}
}
// check subject
var subject = document.getElementById('fm_compose_subject');
if(subject.value == '') {
subjectSet = false;
}
// check to infolog/ to tracker. Only one can be checked.
var toinfolog = document.getElementById('to_infolog');
var totracker = document.getElementById('to_tracker');
if (toinfolog.checked==true && totracker.checked==true)
{
doubleCheck = true;
}
if(addressSet == true) {
if(addressSet == true && subjectSet == true && doubleCheck == false) {
// if we submit the form, we do not want to execute the onunload stuff
do_onunload=false;
document.doit.submit();