Solved

Use Group option button.

Posted on 2004-10-04
9
144 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
  • 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

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