Solved

Use Group option button.

Posted on 2004-10-04
9
147 Views
Last Modified: 2010-04-06
Hi experts;
I just am learning about ASP language And this is my first ASP program

<HTML>
<html>
<title>Test </title>
<body bgcolor="#FFFFFF">
<script language="JavaScript">

<BODY>

<%

Dim image
Image = request.form("colour")

Dim Colour
Colour = "noimage.gif"

If image="" Then
  colour = "red.gif"
End If

If Image = "red" or Image = "RED" Then
  colour = "red.gif"
End If

If Image = "yellow" or Image = "YELLOW" Then
 Colour = "yellow.gif"
End If

If Image = "green" or Image = "GREEN" Then
  colour = "green.gif"
End If

%>

<tABLE Width="100">
<TR>
<img src="<%=colour%>"></img>
</TR>

<FORM method="post" action="Test.asp">
<tr>
<td>
<Input type="text" name="colour" id="colour">
</TD>
</TR>
<tr>
<td>
<Input type="submit" value="Color">
</TD>
</TR>
</Form>

</Table>

</Body>

</HTML>


My Question is:

If I want to use Group option button (Not Command button) to select color (instead of input "red", "yellow" or "green", What should i do?
Note: if program can write in VBSCRIPT, it will be great for me but JAVA is also ok.

Thank you
Sonny.
0
Comment
Question by:sonnyhua
[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
  • 2
9 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 84 total points
ID: 12223967
Hi sonnyhua,

You mean like this?

Green: <input type="radio" name="colour" value="green" checked="true" /><br />
Yellow: <input type="radio" name="colour" value="yellow" /><br />
Red: <input type="radio" name="colour" value="red" /><br />


Regards,
Zyloch
0
 
LVL 49

Assisted Solution

by:Roonaan
Roonaan earned 83 total points
ID: 12224568
@ZyLoch: <input type="radio" checked="checked" /> ;-)

-r-
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12224573
Interesting, I thought both would work, learned something new other than on ancient Mesopotamia (blah) ;)
0
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!

 
LVL 49

Expert Comment

by:Roonaan
ID: 12224604
Most browser it does actually, because they only check on the presence of the attribute and not on its value. But the 'official' (blegh) value would be 'checked'.

-r-
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12230873
sonnyhua:

Advisable not to post in feedback section. Post a followup comment here--we hardly ever check feedback, and feedback is not the area to ask questions.

As per what you asked, you can include my provided code inside this:

<td>
<Input type="text" name="colour" id="colour">
</TD>

Substituting the <input type="text" for my code.
0
 
LVL 11

Assisted Solution

by:neester
neester earned 83 total points
ID: 12233975
I would use JAVASCRIPT
becuause VB Script can only be used with Internet Explorer AFAIK...
And therefore its usablity is very limited...
Javascript has more power on the webpage though....
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12242116
Although I think sonny is trying to build an ASP program on a form submit. However, neester is right in that you should use Javascript whenever you can
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

627 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