Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2003, 03:56 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default HTML Code Problem

Hi all,

I am working on a class project for my Intro to Internet Programming course. The DonateTemplate file is basically just an input form where users can input their personal info and submit the form. I've been able to get pretty much all of the page to turn out like I want it to but I am having a problem with one of the list boxes not showing up correctly.


Here's the code:


<html>
<head>

<title>
Adam Smith for Congress 2000 Campaign Site -- Make a Contribution Today
</title>

<script language="Javascript">
<!--
function validation(thisform)
{
 // Check for First Name.
 if (thisform.FirstName.value=="")
 {
  alert("Please be advised that the First Name field is required in order to submit the information successfully. The form will not be submitted unless you correct the error");
  thisform.FirstName.focus();
  return false;
 }
 // Check for Last Name.
 if (thisform.LastName.value=="")
 {
  alert("Please be advised that the Last Name field is required in order to submit the information sucessfully. The form will not be submitted until you correct the error");
  thisform.LastName.focus();
  return false;
 }
 return true
}// function validation()
-->
</script>

</head>

<BODY vlink="black" link="black" bgcolor="white">




<form method="post" onSubmit="return validation(this)"
action="http://matcmadison.edu/faculty/jjones/ITIP/post-echo.asp">

<table border="1" width="400" cellpadding="5" cellspacing="5" align="left">

 <tr>
  <td align="left" bgcolor="#fffff0">

   <p align="left">
    To make an on-line contribution now, please fill out the form below and press the submit button. The information and the amount of your contribution will be sent directly to the Smith for Congress Campaign.
   </p>

  </td>
 </tr>

 <tr>
  <td align="left" bgcolor="#000099">

   <p align="right">
    First Name: <input name="FirstName" size="35" maxlength="50" /><br/>
    Last Name: <input name="LastName" size="35" maxlength="50" /><br/>
    Address: <input name="Address" size="35" malenght="40" /><br/>
    City: <input name="City" size="35" /><br/>
    State: <input name="State" value="CA" size="2" maxlength="2" />
    #160;#160;#160;#160;
    Zipcode: <input name="Zip" size="12" maxlength="14" /><br/>
    Country: <input name="Country" value="US" size="35" maxlength="2" /><br/>
    Employer: <input name="Employer" size="35" maxlength="50" /><br/>
    Occupation: <input name="Occupation" size="35" maxlength="50" /><br/>
    Phone: <input name="Phone" size="35" maxlength="13" /><br/>
    Email Address: <input name="Email" size="35" /><br/>
    Credit Cards Accepted<select name = "Credit Card" size="1" />
           <option selected="true" value="Visa">Visa</option>
           <option value="MasterCard">MasterCard</option>
           <option value="Discover">Discover</option>
           <option value="American Express">American Express</option>
    </select><br/>
    Credit Card #: <input name="CreditCard#" size="15" maxlength="9" /><br/><br/>
   Expires <select name = "Month" size="1" />
   <option selected="true" value="Month">Month</option>
           <option value="January" value="January">January</option>
           <option value="February" value="February">February</option>
           <option value="March" value="March">March</option>
           <option value="April" value="April">April</option>
           <option value="May" value="May">May</option>
           <option value="June" value=June">June</option>
           <option value="July" value="July">July</option>
           <option value="August" value="August">August</option>
           <option value="September" value="September">September</option>
           <option value="October" value="October">October</option>
           <option value="November" value="November">November</option>
           <option value="December" value="December">December</option>
           <select name = "Year" size="1" />
   <option selected="true" value="Year">Year</option>
   </p>
   <p align="center">
    <input type="submit" name="submit" value="Submit" />
    <input type="reset" value="Reset" />
    <br/><br/>
   </p>

  </td>
 </tr>

 <tr>
  <td align="left" bgcolor="#fffff0">

   <p align="left">If you prefer to send a contribution by check, please make it payable to Adam Smith for Congress and send it to:<br/><br/>
   #160;#160;#160;#160;#160; Smith for Congress<br/>
   #160;#160;#160;#160;#160; 35 S. Raymond Avenue, Suite 206<br/>
   #160;#160;#160;#160;#160; Pasadena, CA 91105
   </p>

  </td>
 </tr>
</table>

</form>

</body>
</html>

I'm pretty sure the problem lies in one of the list box definitions. I just don't know what the problem is exactly.

Any help on this issue would be appreciated.

Thanks in advance,


Ben
Madison Area Technical College student
__________________
Ben Horne
-------------------------
I don\'t want to sound like I haven\'t made any mistakes. I\'m confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
 
Old October 8th, 2003, 04:13 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You need to close your <select> tags

           <option value="December" value="December">December</option>
           </select>
           <select name = "Year" size="1" />
and
   <option selected="true" value="Year">Year</option>
   </select>
   </p>


Peter
 
Old October 8th, 2003, 04:16 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Thank God!!

Peter,

Thanks for the help. I knew something wasn't right about the code.

Thanks again

Quote:
quote:Originally posted by planoie
 You need to close your <select> tags

         <option value="December" value="December">December</option>
         </select>
         <select name = "Year" size="1" />
and
<option selected="true" value="Year">Year</option>
</select>
</p>


Peter
Ben
Madison Area Technical College student
 
Old October 8th, 2003, 04:20 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

No problem. Sometimes it just takes a second pair of eyes.
Good luck with school!

Peter
 
Old October 9th, 2003, 03:35 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Just in case, you need tpo remove the closing slash on the opening select as well.
Code:
<select name = "Month" size="1" />
should be:
Code:
<select name = "Month" size="1">

--

Joe
 
Old October 9th, 2003, 10:33 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Good catch joe!

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
a block of html code keyvanjan ASP.NET 1.0 and 1.1 Basics 2 July 14th, 2006 12:48 AM
HTML Code in XML Neelimaa XML 2 May 4th, 2006 07:31 AM
What is wrong in my HTML-code.....?????? Burton HTML Code Clinic 11 October 13th, 2004 08:16 AM
Another HTML Code Problem Ben Horne HTML Code Clinic 3 October 13th, 2003 03:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.