Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 13th, 2004, 10:09 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default Radio buttons over email???

I have a form set up that when it's filled out it's sent to my email. It works great. But I want to add 3 radio buttons and send the vaule along with the form. I keep getting a blank vaule.

<td valign="middle" colspan=2>

<input type=radio name="sublength" VALUE="1">6 Issues - $25.87<br>
<input type=radio name="sublength" VALUE="2">12 Issues - $51.75<br>
<input type=radio name="sublength" VALUE="3">18 Issues - $77.62<br>
</td>

This is my radio buttons.

Session("Sublength") = Request.Form("SubLength")
 & Session("Sublength") & chr(13) & chr(10)

above is how the email is set up. it's set up right I just took the pieces of code that pertain to the radio buttons.

In the resulting email all the fields work except sublength has nothing in it.

Thanks for your help


__________________
-----------------------------------------------------------
\"Don\'t follow someone who\'s not going anywhere\" John Mason
Reply With Quote
  #2 (permalink)  
Old April 15th, 2004, 03:00 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

I had put this in test.asp and I found it working fine. Could you explain in detail or post more code, so as to help you out in a better way.


<%
response.write request.form("Submit") & "<BR><BR>"
response.write Request.form("Sublength")
%>

<HTML>
<HEAD></HEAD>

<BODY>
<Form name="test" method="post" action="test.asp">

    <input type=radio name="sublength" VALUE="1">6 Issues - $25.87<br>
    <input type=radio name="sublength" VALUE="2">12 Issues - $51.75<br>
    <input type=radio name="sublength" VALUE="3">18 Issues - $77.62<br>
    <input type="submit" value="Submit" name="Submit">
</Form>

___________
Cheers!

-Vijay G
Reply With Quote
  #3 (permalink)  
Old April 19th, 2004, 08:51 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is my email handler. All the fields work fine, but when I recieve the email It get
Subscription length:
with no value, I am not sure how to set it up here in the body of the email.

<%@ Language=VBScript %>

<%


    Session("FName") = Request.Form("FName")
    Session("LName") = Request.Form("LName")
    Session("Address") = Request.Form("Address")
    Session("PCode") = Request.Form("PCode")
    Session("Country") = Request.Form("Country")
    Session("Phone") = Request.Form("Phone")
    Session("Fax") = Request.Form("Fax")
    Session("Email") = Request.Form("Email")
    Session("Sublength") = Request.Form("SubLength")

    if not len(Request.Form("Email")) > 0 then
        Session("ErrorFull2") = "You must enter a headline to continue."
        Response.Redirect("default.asp")
    end if

    Set MailObj = CreateObject("CDONTS.NewMail")

    strEmail="email"
    newstr="First Name: " & Session("FName") & chr(13) & chr(10) & "Last Name: " & Session("LName") & chr(13) & chr(10) & "Address: " & Session("Address") & chr(13) & chr(10) & "Postal Code: " & Session("PCode") & chr(13) & chr(10) & "Country: " & Session("Country") & chr(13) & chr(10) & "Phone: " & Session("Phone") & chr(13) & chr(10) & "Fax: " & Session("Fax") & chr(13) & chr(10) & "Email: " & Session("Email") & chr(13) & chr(10) & "Subscription length: " & Session("Sublength") & chr(13) & chr(10)
    MailObj.BodyFormat=1

    MailObj.From=strEmail
    MailObj.Importance=1

    MailObj.Subject="ABN Subscriber"
    MailObj.Body=newstr
    MailObj.To="email"

    MailObj.Send
    Set MailObj = Nothing
    'Session.Abandon
%>
</script>
<html>
<head>
    <title>Atlanticboatingnews.com - Thank You</title>
<link REL="stylesheet" HREF="/oronline.css">
<link REL="SHORTCUT ICON" HREF="/favicon.ico">
</head>


<br>
    <table border="0" cellpadding="1" cellspacing="0" width="97%">
        <tr>
            <td valign="top">
            <br>

                <b>Your Submission has been received, Thank you!</b><br>
                <a href="/default.asp">[u]Click here</u></a> to return to the home page.<br><br><br><br><br><br><br>
            </td>
        </tr>
    </table>


I took out my email address. If you need more just let me know, but everything else is working great except the "sublength".

Thanks for your help

Reply With Quote
  #4 (permalink)  
Old April 19th, 2004, 01:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Did you try with Response.write at top of this page to see if the Value of SubLength comes on to this page?

Response.write Request.Form("SubLength")

Does this show any value?

Failing which you could post some code from the FORM page where you accept input from the user. I hope there should be some problem with your previous page from where you submit to this page.

Cheers!

-Vijay G
Reply With Quote
  #5 (permalink)  
Old April 20th, 2004, 01:01 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<%@ Language=VBScript %>

<html>
<head>
    <title>Atlantic Boating News - Subscribe</title>
<link REL="stylesheet" HREF="/cssonline.css">
</head>


            <table border="0" cellpadding="1" cellspacing="0" width="97%">
                <tr>
                <td valign="top">
                <br>
                <img src="/images/subscribe1.gif" WIDTH="500" HEIGHT="113"><br>



                    <p align="justify">Subscribe now to enjoy Atlantic Canada's only recreational boat & outdoor magazine, Atlantic Boating News - Your Guide to Outdoor Adventure! The magazine offers excellent reading on boating, recreational water sports, and tourism in the Atlantic Provinces.</p>

                    <p align="justify"><B>Atlantic Boating News</B> is a must-have for boat and outdoor enthusiast throughout Atlantic Canada!</p>

                    <table border="0" width="100%" cellpadding="5" cellspacing="0">
                    <tr>
                    <td valign="top">
                    <br>



                    <form METHOD="POST" ACTION="handler.asp" id=form1 name=form1>

<%IF Request.QueryString("ID")>0 THEN%>
    <h2>Edit an Article</h2>
    <INPUT TYPE=hidden NAME="ArticleID" VALUE="<%=RS("ARticleID")%>">
<%else%>
    <h4>To Subscribe fill in the form below</h4>
<%END IF%>
<INPUT TYPE=HIDDEN NAME="form" VALUE="mag">
<TABLE BORDER=0>
    <TR>
        <TD><p class="label">First Name:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=20 NAME="FName" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("FName")%><%end if%>"></TD>
    </TR>
    <TR>
        <TD><p class="label">Last Name:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=20 NAME="LName" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("LName")%><%end if%>"></TD>
    </TR>
    <TR>
        <TD><p class="label">Address:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=50 NAME="Address" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("Address")%><%end if%>"></TD>
    </TR>
    <TR>
        <TD><p class="label">Postal Code:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=10 NAME="PCode" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("PCode")%><%end if%>"></TD>
    </TR>

    <TR>
        <TD><p class="label">Country:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=20 NAME="Country" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("Country")%><%end if%>"></TD>
    </TR>
    <TR>
        <TD><p class="label">Phone #:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=20 NAME="Phone" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("Phone")%><%end if%>"></TD>
    </TR>
    <TR>
        <TD><p class="label">Fax #:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=20 NAME="Fax" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("Fax")%><%end if%>"></TD>
    </TR>
    <TR>
        <TD><p class="label">Email:</p></TD>
        <TD><INPUT TYPE=TEXT SIZE=30 NAME="Email" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("Email")%><%end if%>"></TD>
    </TR>

    <TR colspan=2>
        <td valign="top" colspan=2>

            <BR>
            YES!Please start my Atlantic Boating News Subscription(prices include HST).
            <BR>
        </td></tr>
    <tr colspan=2>
            <td valign="middle" colspan=2>

                   <input type=radio name="sublength" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("1")%><%end if%>">6 Issues - $25.87<br>
                   <input type=radio name="sublength" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("2")%><%end if%>">12 Issues - $51.75<br>
                   <input type=radio name="sublength" VALUE="<%IF Request.QueryString("ID")>0 THEN%><%=RS("3")%><%end if%>">18 Issues - $77.62<br>
            </td>
        </TR>
<tr><td colspan=2>

<P>
<BR>
<INPUT TYPE=SUBMIT NAME="submit" VALUE="Submit">
<INPUT TYPE=reset NAME="reset" VALUE="Reset Form">

</FORM>
</td></tr>

</TABLE>

             </tr>
            </table>

        </td>
    </tr>

</table>

                    </td>


</body>
</html>

Here is my page. You were right the "sublength" is not holding the vaule after it is submitted. I am not sure how to make it work :-(
I hope you can help.

Thanks

Reply With Quote
  #6 (permalink)  
Old April 20th, 2004, 01:21 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got it working now,I think it was a "caps" problem. Thanks for your help!!!!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Radio Buttons jonsey Classic ASP Professional 1 June 6th, 2007 11:48 PM
Radio buttons disappear JoeBob49 ASP.NET 2.0 Basics 2 November 27th, 2006 09:57 AM
Getting Values from Radio Buttons via Email JAMD PHP How-To 0 November 21st, 2006 11:35 AM
How to use the radio buttons? ben_VB VB.NET 2002/2003 Basics 1 January 18th, 2005 12:29 PM



All times are GMT -4. The time now is 08:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.