468,535 Members | 1,662 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,535 developers. It's quick & easy.

Inserting text box into a form, displaying values from recordset

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
Jul 19 '05 #1
2 4158
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" <bi***********@gospellight.com> wrote in message
news:8d**************************@posting.google.c om...
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

Jul 19 '05 #2
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.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Geoff Wickens | last post: by
reply views Thread by Marko Poutiainen | last post: by
6 posts views Thread by 35th Ave Media | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.