My code works in Firefox but not Internet Explorer
<p>This code works fine in Firefox but IE9 returns an error of  '_area' is undefined</p>

<pre><code>function dbasetype(){

    var dbasedata = document.forms[0]._dbase_name.value;
    dbasedata = dbasedata.toUpperCase();
    dbasedata = dbasedata.replace(/\s/g, "");


    if  (dbasedata.indexOf("UK_CONTACTS")==-1) {
        _area.value = _dbase_name.value;            
    } else {
        setarea();
    }
</code></pre>

<p>After your responses I have now changed to code to this and it works. I can't figure out why it worked in Firefox without the definitions. I guess it carried them from the fucntion that was calling this function?</p>

<pre><code>function dbasetype(){

var dbasedata = document.forms[0]._dbase_name.value;
        dbasedata = dbasedata.toUpperCase();
        dbasedata = dbasedata.replace(/\s/g, "");

var area = document.forms[0]._area;     
var _dbase_name = document.forms[0]._dbase_name;

if  (dbasedata.indexOf("UK_CONTACTS")==-1) {
        area.value = _dbase_name.value;         
     } else { setarea(); }
     }
}
</code></pre>
