This demo seems a is for the beginner but always a good refresher for the experienced programmer as I recently experienced. Was working on a project that involved IF THEN and SELECT CASE Statements and need a basic how-to to refresh my mind how they work!! One thing I forgot was Values are case sensative, for example--when selecting Green it wasn't appearing. After some review the value was green. The letter "g" wasn't capitialized! Geez! So we want to share this demo on ASPFree.com if it help our users! Using a SELECT CASE is a very efficient way of nesting several instances based on user input. Instead of using IF THEN ELSEIF statements this offers you must more flexiability. Heres the code Page One <html><head><title></title></head><body> <P> </P> <form method="post" action="selectcase.asp" name="form1"> <TABLE border=1 cellPadding=1 cellSpacing=1 width="75%">
<TR> <TD><STRONG><FONT color=green>Green</FONT></STRONG></TD> <TD><INPUT name=radio1 type=radio value=Green checked></TD></TR> <TR> <TD><FONT color=blue>Blue</FONT></TD> <TD><INPUT name=radio1 type=radio value=Blue></TD></TR> <TR> <TD><FONT color=red>Red</FONT></TD> <TD><INPUT value=Red name=radio1 style="LEFT: 30px; TOP: 15px" type=radio></TD></TR> <TR> <TD><STRONG>Black</STRONG></TD> <TD><INPUT value=Black name=radio1 type=radio></TD></TR></TABLE> <P><INPUT id=submit1 name=submit1 type=submit value="SELECT CASE DEMO"></P> </form> <P> </P> </body></html> Page 2 <%@ Language=VBScript %> <%
dim myRadioColor
myRadioColor = request("radio1")
Select Case myRadioColor
Case "Green" strColor = "Green"
Case "Blue" strColor ="Blue"
Case "Red" strColor = "Red"
Case "Black" strColor = "Black"
Case Else strColor = "Purple"
End Select %> <HTML> <HEAD> </HEAD> <BODY>
<h1>You chose the color: <% = strColor %></h1>
</BODY> </HTML> | DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More ASP Code Articles More By aspfree developerWorks - FREE Tools! | Building a software-as-a-service solution requires addressing a few key technical challenges. In this webcast, we'll focus on the role of IBM Tivoli Directory Server and WebSphere Portlet Factory in creating a Software as a Service solution. We will demonstrate how to use Tivoli Directory Server to prevent the user population of one tenant from accessing the virtual portal and portlet components of another tenant. We will also use the dynamic profile capability of WebSphere Portlet Factory to create multiple highly customized applications from one code base. FREE! Go There Now!
| | | | This whitepaper presents the benefits of successfully introducing static analysis into your organization using IBM Rational Software Analyzer. Additionally, it identifies some common pitfalls that can hinder the effective use of static analysis tooling as well as presents 10 simple strategies designed to help you quickly realize the value of static analysis using Rational Software Analyzer. FREE! Go There Now!
| | | | Poor Requirements Management capabilities in an Enterprise have been linked to excessive project failures, escalating IT costs, and failure to deliver competitive advantage into the marketplace. Join Brianna M Smith from IBM Rational and learn about how successful organizations align IT and Business stakeholders through collaborative processes and tools for effective requirements management, and how an integrated approach across the IT lifecycle can provide unparalleled visibility and traceability to ensure that project teams are delivering on the business vision by "doing the right things" and "doing things right." FREE! Go There Now!
| | | | Learn to enable users to both rate existing animations and to combine existing animations into new snippets. This is the third in a series of three tutorials that chronicle the building of a site that enables collaborative discussion and animation building using Domino and OpenLaszlo. FREE! Go There Now!
| | | | Download a free trial version of IBM Rational Developer for System z, software that can help you deliver core development capabilities; the power of Java Platform, Enterprise Edition (Java EE); and rapid application development support to diverse enterprise application development teams. With comprehensive development tools to help create, deploy and maintain traditional enterprise and composite applications, Rational Developer for System z enables developers with different technical backgrounds to easily participate in important technology projects. FREE! Go There Now!
| | | | Manage, govern, and share services across your organization by using WebSphere Service Registry and Repository. Follow the hands-on exercises to learn how to navigate the Web interface to publish, find, reuse, and update services. FREE! Go There Now!
| | | | Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available. FREE! Go There Now!
| | | | Asset Reuse is a key strategy for companies looking to create innovative solutions to solve complex software development problems. Searching for, identifying, updating, using and deploying software assets can be a difficult challenge. Listen to this webcast, to learn about strategies and tools that you can leverage for a successful project, including Rational Asset Manager, Rational Software Architect and WebSphere Service Registry and Repository. FREE! Go There Now!
| | | | Portfolio Management is about effectively managing portfolio value by aligning portfolio investments with business goals. This complimentary e-kit provides a collection of materials that can help you understand how IBM Rational enables and automates best practices for improved governance and clear visibility into portfolio and project performance across the entire IT project lifecycle. FREE! Go There Now!
| | | | With IBM Rational Systems Development Solution, you can deliver products faster with higher quality. Within this kit, Read the “Model Driven Systems Development” white paper to see how to improve product quality and communication. Then check out the rest of the e-Kit to learn more about important topics that can affect the success of any software project through customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems. From start to finish, at every stage in your projects, Rational Systems Development Solution can help your company reach its full potential. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |