[sclug] Mailto in Firefox not working - what to do?

Neil Haughton n.a.haughton at bigfoot.com
Thu Sep 15 18:24:02 UTC 2005


Are there any Firefox/html gurus out there? I find that mailto doesn't 
work in Firefox on my machine (I'm using Thunderbird as my MUA, but I 
have kmail installed as well). I can't find any Firefox settings that 
pertain to mailing from a web page, in the Preferences or in the 
about:config page, and it's annoying me.

Here's an example html fragment that doesn't work - it looks simple 
enough to me, but there may be something non-standard about it that only 
IE likes. (I've stripped out all the extraneous html outside the form, 
and a lot of repetitive <tr>'s inside it.)

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>


<form action="mailto:sales at kfps.co.uk?subject=Printer Spares Inq. (ref web)" method="post" enctype="text/plain" name="form1" id="form1">
        <table width="650" border="0" cellspacing="10">
          <tr> 
            <td class="kfps">Name*</td>
            <td><input name="name" type="text" id="name" /></td>
            <td class="kfps">Company</td>
            <td><input name="company" type="text" id="company" /></td>

          </tr>

		lot of rows stripped out here

          <tr> 
            <td colspan="4"><input name="Submit" type="submit" onclick="MM_validateForm('name','','R','email','','RisEmail','manufacturer','','R','model','','R','fault','','R');return document.MM_returnValue" value="Submit Information to KFPS" /> 
              <input name="reset" type="reset" id="reset" value="Reset Form" /></td>
          </tr>
        </table>
        <br />
      </form>



Any ideas anyone?

Neil.




More information about the Sclug mailing list