How to Get Rid of Commas

Discussion in 'HTML' started by tp_michele_jones@hotmail.com, Feb 18, 2005.

  1. Guest

    Hi,

    I'm collecting an email address in one asp page as follows:

    <%@ Language="VBScript"%>
    <%Option Explicit%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <title>Mailing Services</title>
    </head>
    <html>
    <body topmargin="0" leftmargin="0" bgcolor="#000000" text="#000000"
    link="#000000" vlink="#000000" alink="#000000">
    <form method="POST" action="overstockconf.asp">
    <table border="0" cellpadding="0" cellspacing="0" width="650">
    <tr>
    <td></td>
    <td>E-mail</td>
    <td><input type="TEXT" name="Email" size="50"></td>
    </tr>
    </table>
    <%
    Response.Write ("<input type=hidden name=Email value=" &
    request.querystring("Email") & ">")
    %>
    </form>
    </body>
    </html>

    And then I'm printing it out in a second asp page and an email as
    follows:

    <%@ Language="VBScript"%>
    <%Option Explicit%>
    <%
    Dim strEmail
    strEmail = Request.Form("Email")
    strFrom = ""
    strTo = ""
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <title>Mailing Services-Confirmation</title>
    </head>
    <html>
    <body topmargin="0" leftmargin="0" bgcolor="#000000" text="#ffffff"
    link="#990033" vlink="#003300" alink="#cc6600">
    <form method="POST" action="overstockconf.asp">
    <table border="0" cellpadding="0" cellspacing="0" width="650">
    <tr>
    <td>&nbsp;</td>
    <td>Email</td>
    <td><%= Request.Form("Email")%></td>
    </tr>
    </table>
    <%
    Dim objMail
    Set objMail = CreateObject("CDONTS.NewMail")
    objMail.From = strFrom
    objMail.To = strTo
    objMail.Subject = "Overstock Confirmation"
    StrMessage = strMessage & "Authorizing Person's Email - " &
    Request.Form("Email") & vbCrLf
    objMail.Body = strMessage
    objMail.Send
    Set objMail = nothing
    %>
    </form>
    </body>
    </html>

    Both the second asp page and the email add a comma after the email
    address that was entered in the field in the first asp page. Does any
    one know how to get rid of it.

    I'm a new web developer and have lots of books all over my desk. I've
    check news groups, but I still can't seem to figure this one out. I'm
    hoping it's a silly little mistake.

    Thanks,

    Michele
    , Feb 18, 2005
    #1
    1. Advertising

  2. Augustus Guest

    <> wrote in message
    news:...
    > Hi,
    >
    > I'm collecting an email address in one asp page as follows:
    >
    > <%@ Language="VBScript"%>
    > <%Option Explicit%>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    > <title>Mailing Services</title>
    > </head>
    > <html>
    > <body topmargin="0" leftmargin="0" bgcolor="#000000" text="#000000"
    > link="#000000" vlink="#000000" alink="#000000">
    > <form method="POST" action="overstockconf.asp">
    > <table border="0" cellpadding="0" cellspacing="0" width="650">
    > <tr>
    > <td></td>
    > <td>E-mail</td>
    > <td><input type="TEXT" name="Email" size="50"></td>
    > </tr>
    > </table>
    > <%
    > Response.Write ("<input type=hidden name=Email value=" &
    > request.querystring("Email") & ">")
    > %>
    > </form>
    > </body>
    > </html>
    >
    > And then I'm printing it out in a second asp page and an email as
    > follows:
    >
    > <%@ Language="VBScript"%>
    > <%Option Explicit%>
    > <%
    > Dim strEmail
    > strEmail = Request.Form("Email")
    > strFrom = ""
    > strTo = ""
    > %>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    > <title>Mailing Services-Confirmation</title>
    > </head>
    > <html>
    > <body topmargin="0" leftmargin="0" bgcolor="#000000" text="#ffffff"
    > link="#990033" vlink="#003300" alink="#cc6600">
    > <form method="POST" action="overstockconf.asp">
    > <table border="0" cellpadding="0" cellspacing="0" width="650">
    > <tr>
    > <td>&nbsp;</td>
    > <td>Email</td>
    > <td><%= Request.Form("Email")%></td>
    > </tr>
    > </table>
    > <%
    > Dim objMail
    > Set objMail = CreateObject("CDONTS.NewMail")
    > objMail.From = strFrom
    > objMail.To = strTo
    > objMail.Subject = "Overstock Confirmation"
    > StrMessage = strMessage & "Authorizing Person's Email - " &
    > Request.Form("Email") & vbCrLf
    > objMail.Body = strMessage
    > objMail.Send
    > Set objMail = nothing
    > %>
    > </form>
    > </body>
    > </html>
    >
    > Both the second asp page and the email add a comma after the email
    > address that was entered in the field in the first asp page. Does any
    > one know how to get rid of it.
    >
    > I'm a new web developer and have lots of books all over my desk. I've
    > check news groups, but I still can't seem to figure this one out. I'm
    > hoping it's a silly little mistake.




    The problem is in this bit of code here:

    -----------------------------------------------------
    <td><input type="TEXT" name="Email" size="50"></td>
    </tr>
    </table>
    <%
    Response.Write ("<input type=hidden name=Email value=" &
    request.querystring("Email") & ">")
    -----------------------------------------------------

    You have 2 form items with the same name... so your next page is showing
    them as a collection.

    IE: if on page 1 you had a form with:
    <input type="text" name="color" value="red">
    <input type="text" name="color" value="green">
    <input type="text" name="color" value="blue">

    and then on the second page you put in:

    response.write request.form("color")

    Your output would look like:
    red, green, blue

    and thats because "color" refers to 3 form items on the first page... and
    thats your problem: you have 2 form items on the first page with the same
    name: "Email"

    As a side note: your code above uses CDONTS... you should, to save yourself
    time and headaches in the future, start switching to CDO instead. The two
    (CDO and CDONTS) are almost the same as far as sending out an email goes,
    but the big difference is that CDONTS is no longer supported in Windows
    Server 2003... so when your host eventually switches to Win2K3 (or you get a
    new host) you don't end up with potentially a bunch of pages that need
    converting to the new way of doing email from the server.
    Augustus, Feb 18, 2005
    #2
    1. Advertising

  3. Richard Guest

    On 18 Feb 2005 09:49:56 -0800 wrote:

    > Hi,


    > I'm collecting an email address in one asp page as follows:


    > <%@ Language="VBScript"%>


    I trust you understand that VBscript will only work in IE??
    i was going to use it myself until I found that out.
    Richard, Feb 18, 2005
    #3
  4. WebMaster Guest

    "Richard" <Anonymous@127.001> wrote in message
    news:...
    > On 18 Feb 2005 09:49:56 -0800 wrote:
    >
    > > Hi,

    >
    > > I'm collecting an email address in one asp page as follows:

    >
    > > <%@ Language="VBScript"%>

    >
    > I trust you understand that VBscript will only work in IE??


    it's an asp page, so it's serverside. Wich client you use is therefore
    irrelevant...

    Rudy
    WebMaster, Feb 18, 2005
    #4
  5. Duende Guest

    While sitting in a puddle Richard scribbled in the mud:

    > On 18 Feb 2005 09:49:56 -0800 wrote:
    >
    >> Hi,

    >
    >> I'm collecting an email address in one asp page as follows:

    >
    >> <%@ Language="VBScript"%>

    >
    > I trust you understand that VBscript will only work in IE??
    > i was going to use it myself until I found that out.
    >
    >
    >

    Why?


    --
    D?
    Adults die young.
    Duende, Feb 18, 2005
    #5
  6. WebMaster wrote:

    > "Richard" <Anonymous@127.001> wrote in message
    > news:...
    >
    >> On 18 Feb 2005 09:49:56 -0800 wrote:
    >>
    >>> I'm collecting an email address in one asp page as follows:

    >>
    >>> <%@ Language="VBScript"%>

    >>
    >> I trust you understand that VBscript will only work in IE??

    >
    > it's an asp page, so it's serverside. Wich client you use is
    > therefore irrelevant...


    Richard only knows of PurloinedScript...

    --
    -bts
    -This space intentionally left blank.
    Beauregard T. Shagnasty, Feb 18, 2005
    #6
  7. Andy Dingley Guest

    On Fri, 18 Feb 2005 13:09:32 -0600, "Richard" <Anonymous@127.001>
    wrote:

    >> <%@ Language="VBScript"%>

    >
    >I trust you understand that VBscript will only work in IE??


    It also runs on web servers running ASP.

    <%@ Language="VBScript"%>

    Is an ASP statement switching the language for the page into VBScript.


    >i was going to use it myself until I found that out.


    That, and the fact that Basic is beyond you and you still haven't
    written any code anyway, just copied it from others.


    PS to the original poster. VBScript is horrible - use JavaScript
    instead. Much better error trapping is just one good benefit you'll
    see.
    Andy Dingley, Feb 18, 2005
    #7
  8. Richard Guest

    On Fri, 18 Feb 2005 23:49:54 +0000 Andy Dingley wrote:

    > On Fri, 18 Feb 2005 13:09:32 -0600, "Richard" <Anonymous@127.001>
    > wrote:


    >>> <%@ Language="VBScript"%>


    >>I trust you understand that VBscript will only work in IE??


    > It also runs on web servers running ASP.


    > <%@ Language="VBScript"%>


    > Is an ASP statement switching the language for the page into VBScript.


    See people? This is how areply should be, informative.


    >>i was going to use it myself until I found that out.


    > That, and the fact that Basic is beyond you and you still haven't
    > written any code anyway, just copied it from others.


    Excuse me, sir, but I started off in computers writing BASIC codes.
    Why should one take the time to write a duplicate of something that's
    already been written?


    > PS to the original poster. VBScript is horrible - use JavaScript
    > instead. Much better error trapping is just one good benefit you'll
    > see.


    What makes you think VBscript can't do error handling?
    Richard, Feb 19, 2005
    #8
  9. Richard wrote:

    >>> I trust you understand that VBscript will only work in IE??


    > See people? This is how areply should be, informative.


    How about correct? Should they be correct?

    --
    -bts
    -This space intentionally left blank.
    Beauregard T. Shagnasty, Feb 19, 2005
    #9
  10. Andy Dingley Guest

    On Sat, 19 Feb 2005 08:58:58 -0600, "Richard" <Anonymous@127.001>
    wrote:

    >See people? This is how areply should be, informative.


    Don't try flattering to get on my good side - I still think you're the
    Jar Jar Binks of web design,
    Andy Dingley, Feb 19, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grahammer
    Replies:
    2
    Views:
    612
    Grahammer
    Oct 21, 2004
  2. Ante Perkovic

    How to get rid of Page_ClientValidate() ?

    Ante Perkovic, Jul 1, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    6,090
    William F. Robertson, Jr.
    Jul 1, 2003
  3. CT
    Replies:
    0
    Views:
    385
  4. AviraM
    Replies:
    2
    Views:
    6,364
    Manish Pandit
    Sep 28, 2006
  5. Replies:
    8
    Views:
    271
    A. Sinan Unur
    May 25, 2006
Loading...

Share This Page