|
|
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> |
|
Subject:
Re: HTML radio form
Answered By: answerguru-ga on 10 Sep 2006 17:47 PDT Rated: |
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 | |
| |
| |
| |
|
cw20034-ga
rated this answer:
and gave an additional tip of:
$2.00
I thank you for you help. |
|
There are no comments at this time. |
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 Home - Answers FAQ - Terms of Service - Privacy Policy |