newbie question about switch, form and table

From: Peter Brause (saugruessel_at_x-mail.net)
Date: 07/12/04


Date: Mon, 12 Jul 2004 21:44:08 +0200

Hello,
I want to run a simple script which returns the user's input:
<html>
<head>
<title>Project Aswitch</title>
</head>
<body>
<p>Please enter the name of a color (yellow, green, blue) </p>
<table border ="1">
<tr>
<td><input type="TEXT" name="Wert">
</tr>
<tr>
<td align="CENTER"><input type="SUBMIT"></td>
</tr>
<form method="POST" action="aswitch.php">
<?php
switch ($Wert)
{
case "yellow":
echo "<br>Your input: yellow";
break;
case "blue":
echo "<br>Your input: blue";
break;
case "green":
echo "<br>Your input: green";
break;
case "":
echo "<br>Your input: nothing<br>";
default:
echo "<br>Your input: neither empty nor yellow nor blue nor green";
}
?>
</form>
</table>
</body>
</html>
When this script runs the first time, it shows
<quote>
Your input: nothing
Your input: neither empty nor yellow nor blue nor green
</quote>
When I enter "green" and click on the Submit button, the response is the
same.
1. What's wrong with my code?
2. How do I get the responses not inside, but below of the table?
Thanks for helping
Peter



Relevant Pages

  • Re: More than a single script block within a single HEAD and BODY
    ... Can there be more than a single script block in a given HEAD tag? ... The W3C HTML validator lets you paste markup directly into the validation form. ...
    (comp.lang.javascript)
  • Re: Passing variables from Javascript to ASP
    ... <script language="JavaScript"> ... Ray at home ...
    (microsoft.public.inetserver.asp.general)
  • RE: Moving Data
    ... * I need to collect the input data on exampl1.aspx by hitting the review button. ... <script runat="server"> ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: newby Q about using Google Maps with ASP.Net 2.0
    ... Google recommends placing the script in the head and then running it ... In master pages you could conceivably add the script to the head ... ASP.Net does is render HTML to a browser from the server (all that you need ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: What am I doing wrong in updating other frames
    ... (no other frameset file opened in one of your frames) ... "http://www.w3.org/TR/html4/frameset.dtd"</a>;> <HEAD> Table of ContentsIndex ... or other type if script is other than JS ...
    (comp.lang.javascript)