Solved

Use Group option button.

Posted on 2004-10-04
9
142 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now