Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Use Group option button.

Posted on 2004-10-04
9
Medium Priority
?
149 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 336 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 332 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
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!

 
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 332 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

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!

Question has a verified solution.

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

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
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 viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

715 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