displaying values in a text box

B

Bill

I have some values I'm passing from one form to another. When I press
the submit button, I want the quantity I have in the text box on form
a to pass to and display in the text box on form b.

form b is on an asp page, and I'm trying to display the values in this
fashion:

myquantity=request.form("quantity")

response.write "<input type =text name=mybox value=" & myquantity &
">"

However, this is not working, and I can't figure out why.

What else could it be?

Thanks,

Bill
 
E

Evertjan.

Bill wrote on 09 sep 2003 in microsoft.public.inetserver.asp.general:
myquantity=request.form("quantity")

response.write "<input type =text name=mybox value=" & myquantity &
">"

However, this is not working, and I can't figure out why.

When rendered in html, if myquantity has spaces, you are in trouble.

response.write "<input name=mybox value='" & myquantity & "'>"

or

myquantity = "'" & myquantity & "'"
response.write "<input name=mybox value=" & myquantity & ">"

or

<%
myquantity=request.form("quantity")
%>
<input name="mybox" value="<%=myquantity%>">

This last form is less apt to have mistakes like that.

==============

Better make it a habit to put all values in HTML in quotes.
Even: type="text" name="mybox"
type="text" is default, can be left out.
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top