?
Solved

Disabling a drop down box depending on a dynamically generated value

Posted on 2003-03-27
2
Medium Priority
?
132 Views
Last Modified: 2010-04-01
I have a web application a JSP page that has two drop down boxes with following labels:

Box 1 : Choice 1
        Choice 2

Box 2 : Some choices

My requirement is that when i select choice 2 , my Box 2 should get disabled but if i reselect choice 1 then the Box 2 should get enabled. Box 2 should should only be enabled if Choice 1 is selected. Can some one help me out on this.

Thanks
Mrigank
0
Comment
Question by:mrigank
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
thanassis earned 300 total points
ID: 8217166
you can use javascript

<html>
<head>
<script language=javascript>
function box1Change()
{
 if(document.form.box1.value == "choice2")
      document.form.box2.disabled = true
 else
     document.form.box2.disabled = false
 }
 </script>
</head>
<body>
<form name="form">
 <select name="box1" onChange="box1Change()">
        <option value="none" selected>(select)</option>
        <option value="choice1">choice1</option>
        <option value="choice2">choice2</option>
 </select>
  <select name="box2" onChange="">
        <option value="none" selected>(select)</option>
        <option value="about1">about1</option>
        <option value="about2">about2</option>
 </select>
 </form>
</body>
</html>
0
 
LVL 5

Author Comment

by:mrigank
ID: 8243366
Thanks a lot Thanassis .
I got my requirement working .
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question