View Single Post
Old 10-31-2008, 11:17 PM   #3 (permalink)
CrazeD
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,688

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Advanced HTML Forms

Code:
<script type="text/javascript">
function disableOption(index)
{
	switch (index.value)
	{
	case 'LCD':
		document.getElementById('40').disabled = false;
		document.getElementById('50').disabled = false;
		document.getElementById('60').disabled = false;
		document.getElementById('70').disabled = true;
	break;

	case 'DLP':
		document.getElementById('40').disabled = false;
		document.getElementById('50').disabled = false;
		document.getElementById('60').disabled = false;
		document.getElementById('70').disabled = false;
		
	break;

	case 'Plasma':
		document.getElementById('40').disabled = true;
		document.getElementById('50').disabled = false;
		document.getElementById('60').disabled = false;
		document.getElementById('70').disabled = false;
	break;	
	}
}

</script>

<form>
<select onchange="disableOption(this.options[this.selectedIndex]);">
<option value="">Select Television Type</option>
<option value="LCD" id="LCD">LCD</option>
<option value="DLP" id="DLP">DLP</option>
<option value="Plasma" id="Plasma">Plasma</option>
</select>
<br />
<select>
<option value="">Select Your Size</option>
<option value="40" id="40">40&quot;</option>
<option value="50" id="50">50&quot;</option>
<option value="60" id="60">60&quot;</option>
<option value="70" id="70">70&quot;</option>
</select>
</form>
Is this what you meant?
__________________

Need website help? PM me!
CrazeD is offline