Inserting text box into a form, displaying values from recordset

B

Bill

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
 
R

Ray at

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
 
A

Andrew Durstewitz

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.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top