471,863 Members | 938 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,863 software developers and data experts.

(java script) How can i disable a drop down list?

Hi,

I want to disable drop down list according to the selection on radio buttons.

my code
[HTML] <td > SEARCH </td>
<td><input type="radio" name="letterOption" ></td>
<td> <select name="letter"/> </td>
<td><input type="radio" name="fileOption" ></td>
<td> <select name="fileName"/> </td>
[/HTML]
If user selects letterOption then the second fileOption and select list should be disabled.
How can i acheive this.?
Aug 22 '07 #1
1 1763
acoder
16,027 Expert Mod 8TB
Please use code tags when posting code.

Use the onclick event handler on the radio button to control the disabling.

Use the 'disabled' property to disable an element:
Expand|Select|Wrap|Line Numbers
  1. selObj.disabled = true;
Aug 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Dan | last post: by
7 posts views Thread by dbabin | last post: by
4 posts views Thread by =?Utf-8?B?S2VycnlD?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.