Jump to content

Firefox & Opera dig it; IE doesn't


h8ids

Recommended Posts

Why does IE suck? Save that one for another thread.

Using JavaScript to disable and enable a textarea based upon a drop down selection. All options, but the last one, in the selection box are set to disable the textarea. The text area is set to disabled by default.

All entered text and the drop down selection are to be saved to a database.

Here's the source:

[code]
<html>
<body>
<form method="POST" action="dataincourse.php" name="form1">

<script>
function enable6(){
if (document.all || document.getElementById){
if (document.form1.test6.disabled==true)
document.form1.test6.disabled=false
else
document.form1.test6.disabled=false
}
}
function disable6(){
if (document.all || document.getElementById){
if (document.form1.test6.disabled==true)
document.form1.test6.disabled=true
else
document.form1.test6.disabled=true
}
}
</script>
<!--how often will the course be taught--><br><font color="#FFFFFF"><a name="offer"></a>
<b>10.</b> How often will the course be taught? </font>
<select size="1"  name="dropdown" style="background-color: lightyellow">
<option name="dairy" value="Please Choose One" onclick="disable6()">Please Choose One</option>
<option name="protein" value="On a regular basis - Probably Annually" onclick="disable6()">On a regular basis - Probably Annually</option>
<option name="protein" value="On a regular basis - Probably Biennually" onclick="disable6()">On a regular basis - Probably Biennually</option>
<option name="protein" value="One time only" onclick="disable6()">One time only</option>
<option name="protein" value="Other - Please specify" onclick="enable6()">Other - Please specify</option></select>
<!--<select style='background-color: lightyellow' name="Offered">
    <option value="Please Choose One">Please Choose One</option>
    <option value="On a regular basis - Probably annually">On a regular basis - Probably annually</option>
    <option value="On a regular basis - Probably biennually">On a regular basis - Probably biennually</option>
    <option value="One time only">One time only</option>
    <option value="Other - Please specifiy">Other - Please specifiy</option>
</select>-->
<br><font color="#FFFFFF"><b>Other specification: </b></font>
<textarea id="test6" type="text" style="background-color: lightyellow" name="OtherOffered" cols="58" maxlength="500" disabled></textarea>
</span>
</form>
</body>
</html>[/code]
Link to comment
https://forums.phpfreaks.com/topic/3533-firefox-opera-dig-it-ie-doesnt/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.