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.
Text box:
<label for="ftp_hostname">
FTP Hostname
</label>
<input type="text" value="<?php echo $row['ftphost']; ?>" class="required" name="ftp_hostname" class="text">
Javascript:
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!");
}