Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

Use Group option button.

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
sonnyhua
Asked:
sonnyhua
  • 4
  • 2
3 Solutions
 
ZylochCommented:
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
 
RoonaanCommented:
@ZyLoch: <input type="radio" checked="checked" /> ;-)

-r-
0
 
ZylochCommented:
Interesting, I thought both would work, learned something new other than on ancient Mesopotamia (blah) ;)
0
Technology Partners: 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!

 
RoonaanCommented:
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
 
ZylochCommented:
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
 
neesterCommented:
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
 
ZylochCommented:
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

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!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now