Google Answers Logo
View Question
 
Q: HTML radio form ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: HTML radio form
Category: Computers > Programming
Asked by: cw20034-ga
List Price: $20.00
Posted: 10 Sep 2006 13:23 PDT
Expires: 10 Oct 2006 13:23 PDT
Question ID: 763943
My family and some friends have an NFL football league.  It's a
win/loss only league for bragging rights.  I have an html form that I
am trying to get ALL the radio options to email me since I am the
quasi commissioner, not just the first option picked.

What I would like is a working example.  It can be PHP if that makes it easier.

Thank you for your help.

Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Week 1</title>
</head>
<form action = "mailto:test@test.com?subject=Week%201%20Picks">
<body>
<font face = Courier New>
-------------<b>Bold is at home</b>-----------------<br>

<br>
<br>

<b>Week 1<br>
Thursday, Sep. 7</b><br>
<br>

<input type = "radio" name = "g0" value = "MIA"> Miami at 
<input type = "radio" name = "g0" value = "PIT"> <b>Pittsburgh</b>

<br>

<b>Sunday, Sep. 10</b><br>

<input type = "radio" name = "g1" value = "ATL"> Atlanta at 
<input type = "radio" name = "g1" value = "CAR"> <b>Carolina</b>
<br>


<input type = "radio" name = "g2" value = "BAL"> Baltimore  at 
<input type = "radio" name = "g2" value = "TB"> <b>Tampa Bay</b>

<br>

<input type = "radio" name = "g3" value = "BUF"> Buffalo at 
<input type = "radio" name = "g3" value = "NE"> <b>New England</b>

<br>

<input type = "radio" name = "g4" value = "CIN"> Cincinnati - 
<input type = "radio" name = "g4" value = "KC"> <b>Kansas City</b>

<br>

<input type = "radio" name = "g5" value = "DEN"> Denver at 
<input type = "radio" name = "g5" value = "CLE"> <b>Cleveland</b>

<br>

<input type = "radio" name = "g6" value = "NYJ"> NY Jets at 
<input type = "radio" name = "g6" value = "TEN"> <b>Tampa Bay</b>

<br>

<input type = "radio" name = "g7" value = "PHI"> Philadelphia at 
<input type = "radio" name = "g7" value = "HOU"> <b>Houston</b> 

<br>

<input type = "radio" name = "g8" value = "SEA"> Seattle at 
<input type = "radio" name = "g8" value = "DET"> <b>Detroit</b>

<br>

<input type = "radio" name = "g9" value = "CHI"> Chicago at 
<input type = "radio" name = "g9" value = "GB"> <b>Green Bay</b>

<br>

<input type = "radio" name = "g10" value = "DAL"> Dallas at 
<input type = "radio" name = "g10" value = "JAC"> <b>Jacksonville</b>

<br>

<input type = "radio" name = "g11" value = "SF"> San Fran at 
<input type = "radio" name = "g11" value = "AZI"> <b>Arizona</b>

<br>

<input type = "radio" name = "g12" value = "NYJ"> NY Jets at 
<input type = "radio" name = "g12" value = "TEN"> <b>Tampa Bay</b>

<br>

<input type = "radio" name = "g13" value = "IND"> Indianapolis at 
<input type = "radio" name = "g13" value = "NYG"> <b>NY Giants</b>

<br>

<b>Monday, Sep. 11</b>

<br>

<input type = "radio" name = "g14" value = "MIN"> Minnesota at 
<input type = "radio" name = "g14" value = "WAS"> <b>Washington</b>

<br>

<input type = "radio" name = "g15" value = "SD"> San Diego at 
<input type = "radio" name = "g15" value = "OAK"> <b>Oakland</b>

<br>
<br>

<input type = "submit" value = "Week 1 Picks">

<br>
<br>
You can check the team or email directly.
<br>

<h3><a href="mailto:test@test.com?subject=Week%201%20Picks">Email Your
Picks!</a></h3>
</center>
</font>
</form>
</body>
</html>
Answer  
Subject: Re: HTML radio form
Answered By: answerguru-ga on 10 Sep 2006 17:47 PDT
Rated:5 out of 5 stars
 
Hi cw20034-ga,

Using your example above, I was able to detect why the selections
being made on your page were not making to the email that was being
generated.

It turns out that your <form> tag didn't have a method="post" attribute. 

The updated tag looks like this:
<form method="post" action="mailto:test@test.com?subject=WeekOnePicks">

Specifying POST when submitting a form means that you want to pass
along the name/value pairs of all the controls on that page.

I also added a hidden field which holds the week number. This makes it
easier for you to see what week's picks were submitted.

Here is the updated code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Week 1</title>
</head>
<form method="post" action="mailto:test@test.com?subject=Week%201%20Picks"">
<body>
<font face = Courier New>
-------------<b>Bold is at home</b>-----------------<br>

<br>
<br>

<b>Week 1<br>
<input type="hidden" name="PicksForWeek" value="1" />

Thursday, Sep. 7</b><br>
<br>

<input type = "radio" name = "g0" value = "MIA"> Miami at 
<input type = "radio" name = "g0" value = "PIT"> <b>Pittsburgh</b>

<br>

<b>Sunday, Sep. 10</b><br>

<input type = "radio" name = "g1" value = "ATL"> Atlanta at 
<input type = "radio" name = "g1" value = "CAR"> <b>Carolina</b>
<br>


<input type = "radio" name = "g2" value = "BAL"> Baltimore  at 
<input type = "radio" name = "g2" value = "TB"> <b>Tampa Bay</b>

<br>

<input type = "radio" name = "g3" value = "BUF"> Buffalo at 
<input type = "radio" name = "g3" value = "NE"> <b>New England</b>

<br>

<input type = "radio" name = "g4" value = "CIN"> Cincinnati - 
<input type = "radio" name = "g4" value = "KC"> <b>Kansas City</b>

<br>

<input type = "radio" name = "g5" value = "DEN"> Denver at 
<input type = "radio" name = "g5" value = "CLE"> <b>Cleveland</b>

<br>

<input type = "radio" name = "g6" value = "NYJ"> NY Jets at 
<input type = "radio" name = "g6" value = "TEN"> <b>Tampa Bay</b>

<br>

<input type = "radio" name = "g7" value = "PHI"> Philadelphia at 
<input type = "radio" name = "g7" value = "HOU"> <b>Houston</b> 

<br>

<input type = "radio" name = "g8" value = "SEA"> Seattle at 
<input type = "radio" name = "g8" value = "DET"> <b>Detroit</b>

<br>

<input type = "radio" name = "g9" value = "CHI"> Chicago at 
<input type = "radio" name = "g9" value = "GB"> <b>Green Bay</b>

<br>

<input type = "radio" name = "g10" value = "DAL"> Dallas at 
<input type = "radio" name = "g10" value = "JAC"> <b>Jacksonville</b>

<br>

<input type = "radio" name = "g11" value = "SF"> San Fran at 
<input type = "radio" name = "g11" value = "AZI"> <b>Arizona</b>

<br>

<input type = "radio" name = "g12" value = "NYJ"> NY Jets at 
<input type = "radio" name = "g12" value = "TEN"> <b>Tampa Bay</b>

<br>

<input type = "radio" name = "g13" value = "IND"> Indianapolis at 
<input type = "radio" name = "g13" value = "NYG"> <b>NY Giants</b>

<br>

<b>Monday, Sep. 11</b>

<br>

<input type = "radio" name = "g14" value = "MIN"> Minnesota at 
<input type = "radio" name = "g14" value = "WAS"> <b>Washington</b>

<br>

<input type = "radio" name = "g15" value = "SD"> San Diego at 
<input type = "radio" name = "g15" value = "OAK"> <b>Oakland</b>

<br>
<br>

<input type = "submit" value = "Week 1 Picks">

<br>
<br>
You can check the team or email directly.
<br>

<h3><a href="mailto:test@test.com?subject=Week%201%20Picks">Email Your
Picks!</a></h3>
</center>
</font>
</form>
</body>
</html>

What you should get now when submitting this form is an email with a
file called POSTDATA.ATT attached to the email. IT is a plain text
file containing the name/value pairs of each control on the page.

Enjoy the upcoming football season, and thanks for using Google Answers!

Cheers,
answerguru-ga

Request for Answer Clarification by cw20034-ga on 12 Sep 2006 07:53 PDT
I have another issue, wife has a MAC.  The default browser is Safari. 
She also has MC office for MAC.  Safari sends only PicksForWeek and
not the choices she picks, Firefox for MAC works just fine.  Both go
through Entourage.
Any help would be great.

Clarification of Answer by answerguru-ga on 13 Sep 2006 17:47 PDT
Hello there,

The issue your wife is having seems to be a seperate issue - you may
want to post it as a new question (although it seems you have a
workaround by using Firefox).

answerguru-ga

Request for Answer Clarification by cw20034-ga on 14 Sep 2006 07:29 PDT
True? It is separate but all seem to be related to how the MS Office
email program has odd issues with it.  May have to ask about those
individually.
Thank you,
Chad

Clarification of Answer by answerguru-ga on 15 Sep 2006 08:17 PDT
Thank you for the positive rating and tip :)
cw20034-ga rated this answer:5 out of 5 stars and gave an additional tip of: $2.00
I thank you for you help.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy