Response.write RecordSet values

Discussion in 'ASP General' started by Fawke101, Apr 21, 2004.

  1. Fawke101

    Fawke101 Guest

    Hi there,

    I have a page that response.writes a table if certain conditions exist,
    What i am trying to do is write a table that also has a text box that
    displays a recordset value, is this possible??

    ***
    Response.Write("<input name=Date type=text id=Date>")

    what i want is =

    Response.Write("<input name=Date type=text id=Date value=<%=RS(Date)%>>")
    ***

    I have tried this and it does not work,
    Hope you guys can help

    Thanks

    --
    Thanks in advance

    Fawke

    Please remove ANTI and SPAM
    from my email address before emailing me.

    www.bradflack.com
    Fawke101, Apr 21, 2004
    #1
    1. Advertising

  2. Fawke101

    Phill. W Guest

    "Fawke101" <> wrote in message
    news:%...
    > what i want is =
    >
    > Response.Write("<input name=Date type=text id=Date value=<%=RS(Date)%>>")


    Something like this?
    (lines breaks for clarity only).

    Response.Write "<input " _
    & "name=""Date"" " _
    & "type=""text"" " _
    & "id=""Date"" " _
    & "value=""" & RS( "Date" ).Value & """>"

    HTH,
    Phill W.
    Phill. W, Apr 21, 2004
    #2
    1. Advertising

  3. Fawke101

    Ray at Guest

    Yes, you can do this, but you're mixing ASP within ASP there. Remember, <%
    %> are the asp delimiters, so since you're response.Writing, you're already
    inside a <% %> when you do the <%= %> thing. Two ways:


    Response.Write "<input name=Date type=text value=" &
    RS.Fields.Items("Date").Value & ">"

    or

    %>
    <!-- now in html, not asp! -->

    <input name=Date type=text value=<%=RS.Fields.Item("Date").Value%>>


    You should use quote for your attributes in HTML tags, especially for the
    value. If your value has a space in it, you won't see anything beyond the
    first space. IE:

    <input name="something" type="text" value="hi there">
    as opposed to
    <input name=something type=text value=hi there>

    All you'd see in the latter one is "hi," not "hi there."

    Ray at work

    "Fawke101" <> wrote in message
    news:%...
    > Hi there,
    >
    > I have a page that response.writes a table if certain conditions exist,
    > What i am trying to do is write a table that also has a text box that
    > displays a recordset value, is this possible??
    >
    > ***
    > Response.Write("<input name=Date type=text id=Date>")
    >
    > what i want is =
    >
    > Response.Write("<input name=Date type=text id=Date value=<%=RS(Date)%>>")
    > ***
    Ray at, Apr 21, 2004
    #3
  4. Fawke101

    Fawke101 Guest

    thanks for this guys, got it working

    Ray -
    I cannot response.write and write the values in there using speech marks,
    because the speech/quote marks interfere with the response.write.

    Make sense?

    --
    Thanks in advance

    Fawke

    Please remove ANTI and SPAM
    from my email address before emailing me.

    www.bradflack.com
    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:...
    > Yes, you can do this, but you're mixing ASP within ASP there. Remember,

    <%
    > %> are the asp delimiters, so since you're response.Writing, you're

    already
    > inside a <% %> when you do the <%= %> thing. Two ways:
    >
    >
    > Response.Write "<input name=Date type=text value=" &
    > RS.Fields.Items("Date").Value & ">"
    >
    > or
    >
    > %>
    > <!-- now in html, not asp! -->
    >
    > <input name=Date type=text value=<%=RS.Fields.Item("Date").Value%>>
    >
    >
    > You should use quote for your attributes in HTML tags, especially for the
    > value. If your value has a space in it, you won't see anything beyond the
    > first space. IE:
    >
    > <input name="something" type="text" value="hi there">
    > as opposed to
    > <input name=something type=text value=hi there>
    >
    > All you'd see in the latter one is "hi," not "hi there."
    >
    > Ray at work
    >
    > "Fawke101" <> wrote in message
    > news:%...
    > > Hi there,
    > >
    > > I have a page that response.writes a table if certain conditions exist,
    > > What i am trying to do is write a table that also has a text box that
    > > displays a recordset value, is this possible??
    > >
    > > ***
    > > Response.Write("<input name=Date type=text id=Date>")
    > >
    > > what i want is =
    > >
    > > Response.Write("<input name=Date type=text id=Date

    value=<%=RS(Date)%>>")
    > > ***

    >
    >
    Fawke101, Apr 21, 2004
    #4
  5. Fawke101

    Ray at Guest

    "Fawke101" <> wrote in message
    news:...
    >
    > I cannot response.write and write the values in there using speech marks,
    > because the speech/quote marks interfere with the response.write.
    >
    > Make sense?


    You can response.write quotes. In VBScript, the way to "escape" quotes is
    by doubling them up. Like so:

    Response.Write "
    You can response.write quotes. In VBScript, the way to ""escape"" quotes is
    by doubling them up. Like so:"

    Or:

    Response.Write "<input name=""theName"" type=""text"" value=""" &
    rs.fields.item("date").Value & """>"

    Ray at work
    Ray at, Apr 21, 2004
    #5
    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. Charles A. Lackman
    Replies:
    2
    Views:
    7,976
    Charles A. Lackman
    Jan 11, 2006
  2. Matthew Wieder

    Response.Write and Response.Redirect

    Matthew Wieder, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    678
    Kevin Spencer
    Jul 17, 2003
  3. Gian Paolo Clarici
    Replies:
    0
    Views:
    776
    Gian Paolo Clarici
    Jul 21, 2004
  4. Hung Huynh
    Replies:
    8
    Views:
    290
    Bob Barrows
    Sep 24, 2003
  5. Replies:
    3
    Views:
    145
    Bob Barrows [MVP]
    Jan 23, 2007
Loading...

Share This Page