Inserting text box into a form, displaying values from recordset

Discussion in 'ASP General' started by Bill, Jul 9, 2003.

  1. Bill

    Bill Guest

    I'm trying to create a form that allows me to modify the contents of
    list. When the user clicks on the modify button, it takes them to a
    page which displays the quantity of items they purchase, and allows
    them to update that quantity. So the quantity is shown in a textbox,
    and the content of the text box is drawn from a rs("content").

    But the page is crashing when I run it. I'm having trouble getting the
    response.write textbox line to work. Here's the code:

    response.write "<td align=right><input type="text" name="quantity"
    value=" & rs("qty") & "></td>"

    This is the line that is causing the page to crash. Can't figure out
    why. Can someone give me some insight into this?

    Thanks,

    Bill
     
    Bill, Jul 9, 2003
    #1
    1. Advertising

  2. Bill

    Ray at Guest

    You're getting an error? What is it? Unterminated string constant,
    perhaps? Always post the error.

    What you do when you get an error, look at the line of the error, and think
    about what would happen if you were the server. If you were the server
    here, would you know which " are part of HTML and which are part of the
    string that you want to response.write? No. That's what the problem is.
    Your " right before the word "text" is the end of a string, as far as your
    server's concerned. To "escape" quotes in VBScript, you double them.

    response.write "<td align=right><input type=""text"" name=""quantity""
    value=""" & rs("qty") & "></td>"

    Ray at work

    "Bill" <> wrote in message
    news:...
    > I'm trying to create a form that allows me to modify the contents of
    > list. When the user clicks on the modify button, it takes them to a
    > page which displays the quantity of items they purchase, and allows
    > them to update that quantity. So the quantity is shown in a textbox,
    > and the content of the text box is drawn from a rs("content").
    >
    > But the page is crashing when I run it. I'm having trouble getting the
    > response.write textbox line to work. Here's the code:
    >
    > response.write "<td align=right><input type="text" name="quantity"
    > value=" & rs("qty") & "></td>"
    >
    > This is the line that is causing the page to crash. Can't figure out
    > why. Can someone give me some insight into this?
    >
    > Thanks,
    >
    > Bill
     
    Ray at, Jul 9, 2003
    #2
    1. Advertising

  3. It sounds to me like you are posting back to the same page (assumption)
    and you are getting the error when the feild is empty.

    I would so something like...

    If Not rs.EOF Then
    Response.Write "blah, blah"
    End If

    hth,
    Andrew

    * * * Sent via DevBuilder http://www.devbuilder.org * * *
    Developer Resources for High End Developers.
     
    Andrew Durstewitz, Jul 9, 2003
    #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. =?Utf-8?B?Um9iZXJ0IEhhbHN0ZWFk?=

    Problem with text when inserting into text box

    =?Utf-8?B?Um9iZXJ0IEhhbHN0ZWFk?=, Apr 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    409
    Somchai U.
    Apr 27, 2004
  2. thersitz
    Replies:
    3
    Views:
    647
    thersitz
    Jan 31, 2007
  3. Bill

    displaying values in a text box

    Bill, Sep 9, 2003, in forum: ASP General
    Replies:
    1
    Views:
    93
    Evertjan.
    Sep 9, 2003
  4. Hung Huynh
    Replies:
    8
    Views:
    313
    Bob Barrows
    Sep 24, 2003
  5. News Groups
    Replies:
    1
    Views:
    200
    Ray at
    Aug 11, 2004
Loading...

Share This Page