Using Post but losing data due to spaces???

Discussion in 'ASP General' started by Drifter, Apr 8, 2004.

  1. Drifter

    Drifter Guest

    I am generating a list with checkboxes from a database:

    Response.Write (" <FORM METHOD='POST' ACTION='listpage.asp?Verified=True'
    NAME = 'Subscriptor' onsubmit=""return
    howManyChecked('Subscriptor','ITitle'',9,9,'Inservice');"">")

    <Input Type='CheckBox' Name='ITitle' Value=" & rsData("Name") & ">...

    <% 'Response.Write Request.Form("ITitle") %>

    I have some code that verifies if 5 titles are checked (howManyChecked),
    then I send this list of 5 titles to the next area. Problem is I am asking
    for the "Name" from the database, and the name contains spaces. When I go to
    generate the list on the next area I get only the first Word, if there is a
    space in the "Name" the collection takes this as the end of the Name data,
    and goes onto the next Name, taking only the first word again.

    I can get around the issue by changing it to the ID being transferred in the
    ITitle, and then calling database to collect the data (Name) again. This
    seems an unnecessary step. Any ideas how I can drop the problem of losing
    data after the spaces?

    D
    Drifter, Apr 8, 2004
    #1
    1. Advertising

  2. Drifter

    Roland Hall Guest

    "Drifter" wrote in message
    news:c53oj4$s8r$...

    : <Input Type='CheckBox' Name='ITitle' Value=" & rsData("Name") & ">...

    This line cannot work in this format:
    Response.Write("<Input Type='CheckBox' Name='ITitle' Value='" &
    rsData("Name") & "' />")

    or

    <Input Type='CheckBox' Name='ITitle' Value='<%=rsData("Name")%>' />


    : <% 'Response.Write Request.Form("ITitle") %>
    :
    : I have some code that verifies if 5 titles are checked (howManyChecked),
    : then I send this list of 5 titles to the next area. Problem is I am asking
    : for the "Name" from the database, and the name contains spaces. When I go
    to
    : generate the list on the next area I get only the first Word, if there is
    a
    : space in the "Name" the collection takes this as the end of the Name data,
    : and goes onto the next Name, taking only the first word again.
    :
    : I can get around the issue by changing it to the ID being transferred in
    the
    : ITitle, and then calling database to collect the data (Name) again. This
    : seems an unnecessary step. Any ideas how I can drop the problem of losing
    : data after the spaces?

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Apr 9, 2004
    #2
    1. Advertising

  3. Drifter

    Drifter Guest

    Hehhe - oh yah - 'quotes'. That did the trick.

    Thanks,

    D

    "Peter Foti" <> wrote in message
    news:...
    > "Drifter" <loreseeker_prime@hotmail*removethis*.com> wrote in message
    > news:c53oj4$s8r$...
    > > I am generating a list with checkboxes from a database:
    > >
    > > Response.Write (" <FORM METHOD='POST'

    ACTION='listpage.asp?Verified=True'
    > > NAME = 'Subscriptor' onsubmit=""return
    > > howManyChecked('Subscriptor','ITitle'',9,9,'Inservice');"">")
    > >
    > > <Input Type='CheckBox' Name='ITitle' Value=" & rsData("Name") & ">...

    >
    > You need quotes around your Value attribute.
    > <Input Type='CheckBox' Name='ITitle' Value='" & rsData("Name") & "'>...
    >
    > Regards,
    > Peter Foti
    >
    >
    >
    Drifter, Apr 9, 2004
    #3
    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. Fresh
    Replies:
    2
    Views:
    616
    Bo Persson
    Apr 22, 2008
  2. John B. Matthews
    Replies:
    4
    Views:
    651
    John B. Matthews
    Sep 12, 2008
  3. Roedy Green
    Replies:
    3
    Views:
    609
  4. johkar
    Replies:
    2
    Views:
    2,839
    Mayeul
    Dec 10, 2009
  5. Jason C
    Replies:
    4
    Views:
    670
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page