Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


urgent question on disabling

Posted on 1998-12-21
Medium Priority
Last Modified: 2013-12-25
hi, I want to have two combo boxes with radio buttons attached with them. So that when I click radio 1, I can pick the list from the combo1, when I click radio 2, I can pick the list from the combo2. I can't pick combo1 and combo2 at the same time.
Could anyone send me some sample code?
I will appreicate your help!

Question by:mklee
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
  • 4
  • 4

Expert Comment

ID: 1857418
You can't do this in HTML - you will need to use JAVASCRIPT.

Then, use the onClick=xxxx in the <input type=xxxx to invoke a function that checks that all you rules are observed.

Expert Comment

ID: 1857419
What do you mean by picking up from the list? i.e. handling it in any script(CGI or ASP)? If so, which type of scripting you're using?

Author Comment

ID: 1857420
I understand the concept that you answer, but I have no clue how to start? Could anyone give me some simple sample code?
I am using ASP, in this case, after I pick one from either combobox, I will pass the variable to another ASP page and returns the records based on the criteria which i picked from the list.

Thank you

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Accepted Solution

rajgn earned 320 total points
ID: 1857421
Let's say you have a html/asp which has two combos(named combo1, combo2) associated with two radio buttons(named rad but values are different i.e. com1,com2). Example code is as below:

<form method="POST" action="respond.asp">
  <select name="combo1" size="1">
    <option value="-- Select One --">-- Select One --</option>
    <option value="Choice 11">Choice 11</option>
    <option value="Choice 12">Choice 12</option>
  <input type="radio" name="rad" value="com1"></p>
  <select name="combo2" size="1">
    <option value="-- Select One --">-- Select One --</option>
    <option value="Choice 21">Choice 21</option>
    <option value="Choice 22">Choice 22</option>
  <input type="radio" value="com2" name="rad"></p>
  <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset"

This will post to an asp called respond.asp

Now, include following code in respond.asp to handle the request appropriately.

if request.form("rad") = "com1" then
      response.write "select from combo1<BR>"
      response.write "Value is :" & request.form("combo1")
        ' Query the DB and return records based on Combo1, HERE
      response.write "select from combo2<BR>"
      response.write "Value is :" & request.form("combo2")
        ' Query the DB and return records based on Combo2, HERE      
end if

Author Comment

ID: 1857422
thank first.
In this case, user will still be able to select from one of the combo, am I right?
is there a way to disable either one of the combo if user clicks on another one?
That will be great!


Expert Comment

ID: 1857423
Yes, user will still be able to select from one of the combo.

No, You can't disable a combo in HTML (there is no other way unless you use java applets/activeX controls to enable/disable).

In this case even if a User selects options in other combo, it'll not do anything since you're controlling in the script.

Author Comment

ID: 1857424
Do you know how to do it in ActiveX control?
I want to know it.

If you do, I will raise 50 points for your credit.
Thank you very much


Expert Comment

ID: 1857425
May be I was not clear in my last comment (which I felt after posting it). It's impossible to enable/disable any of the forms laid down using HTML. If you want additional functionality of that kind, you've to design your own interface using either ActiveX or Java, then embed them in your page.
If you use ActiveX, you've to design/program the entire control including combos, radio buttons and their functionality using any of the Microsoft development tools (VB, VC++, VJ++ etc..) Once you go for ActiveX so many other issues will arise. It's not supported by all browsers, you need to get certificate for your control to ensure the users browsing your page that your control is safe to download. This process involves some time and effort. And most importantly maintenance in the future may become difficult(since it's developed by somebody else)

My conclusion: for the task of this magnitude I never suggest using ActiveX/Java applets. It's like getting into many other issues for accomplishing a small task in return.

Author Comment

ID: 1857426
I think your answer is very good and professional.


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

610 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