javascript re-define a variable
<p>I'm getting stuck somewhere (as newbies do). Is it ok to re-define a variable once it has been trimmed and tested for content?</p>

<pre><code>    function setarea() {

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

        if (dbasedata != "") {
            _area.value = _dbase_name.value;
        } 

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

        if (dbasedata.indexOf("UK_CONTACTS")&gt;-1 {
        var dbaseterm = "UK_CONTACTS";
   else var dbaseterm = "";     
            }
</code></pre>
