javascript disable text box with if statement
<p>I am attempting to use javascript to detect if "remote_server" is set to 0, if it is then disable the text box "ftp_hostname".  If I uncomment the alert it works, however the field is still not disabled.  </p>

<p>Text box:</p>

<pre><code>&lt;label for="ftp_hostname"&gt;
FTP Hostname
&lt;/label&gt;
&lt;input type="text" value="&lt;?php echo $row['ftphost']; ?&gt;" class="required" name="ftp_hostname" class="text"&gt; 
</code></pre>

<p>Javascript:</p>

<pre><code>var e = document.getElementsByName("remote_server")[0]
var strUser = e.options[e.selectedIndex].value;

if ( strUser == 0 ) {
document.getElementsByName("ftp_hostname")[0].disabled
//alert("selected!");
}
</code></pre>
