?
Solved

urgent question on disabling

Posted on 1998-12-21
9
Medium Priority
?
202 Views
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!

mklee
0
Comment
Question by:mklee
[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
  • 4
  • 4
9 Comments
 
LVL 8

Expert Comment

by:jhurst
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.
0
 
LVL 1

Expert Comment

by:rajgn
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?
0
 

Author Comment

by:mklee
ID: 1857420
jhurst:
I understand the concept that you answer, but I have no clue how to start? Could anyone give me some simple sample code?
rajgn:
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

0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 1

Accepted Solution

by:
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:

<html>
<head>
<title>Combossss...</title>
</head>
<body>
<form method="POST" action="respond.asp">
  <p>
  <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>
  </select>
  <input type="radio" name="rad" value="com1"></p>
  <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>
  </select>
  <input type="radio" value="com2" name="rad"></p>
  <p>&nbsp;</p>
  <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset"
  name="B2"></p>
</form>
</body>
</html>

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
else
      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
%>
0
 

Author Comment

by:mklee
ID: 1857422
rajgn:
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!


0
 
LVL 1

Expert Comment

by:rajgn
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.
0
 

Author Comment

by:mklee
ID: 1857424
rajgn:
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

mklee
0
 
LVL 1

Expert Comment

by:rajgn
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.
0
 

Author Comment

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

mklee
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
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