Response.write RecordSet values

F

Fawke101

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
 
P

Phill. W

Fawke101 said:
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.
 
R

Ray at

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
 
F

Fawke101

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
 
R

Ray at

Fawke101 said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top