I am new to javascript however I am trying to create a if else statement with the following options.
<select name="remote_server" class="required">
<option></option>
<option value="1" <?php if($remote=="1") echo 'selected="selected"'; ?>>Yes</option>
<option value="0" <?php if($remote=="0") echo 'selected="selected"'; ?>>No</option>
</select>
I am looking to do something like
if remote_server = 1 then
document.getElementByName("hostname").disabled = true;
else
nothing
EDIT 1:
I am now trying the following with no success
var e = document.getElementsByName("remote_server");
var strUser = e.options[e.selectedIndex].value;
if ( strUser == 0 ) {
document.getElementsByName("ftp_hostname").disabled = true;
}