Click to See Complete Forum and Search --> : display fields in records on several lines


jleiker
06-09-2003, 10:21 AM
Hi!
The code below displays my record from the database like this:
txtcode-txtname (JLF-mutual of city)
txtcode-txtname
(and so on for as many as I choose to display...size of box)

I want to display it like this...showing only four records at a time:
txtcode
txtname



txt code
txt name
I don't know how to make it display this way???
Here's some of the code:

Response.Write ">" & rs("txtcode") & " - " & rs("txtname") &"</Option>"
rs.MoveNext
Loop
rs.Close

cmelnick
06-09-2003, 11:52 AM
You will have to create two <option>s for each txtcode/txtname pair.


Response.Write "<option value=1>" & rs("txtcode") & "</option>" & _
"<option value=1>" & rs("txtname") & "</option>"
rs.MoveNext


You might want to indent the 2nd <option> or something so you will be able to tell that they are supposed to be the same item. Just make sure the value is the same.

jleiker
06-10-2003, 07:26 AM
This works! Thanks! A couple more questions if you would be so kind. I used this for about 5 options (txtname, txtcode, txt city, txtstate and txt zip.
So showing up like this:

JCL
US American Morse
Lincoln
NB
67490

(Right here I need a space)

JCL
KS United
Hays
KS
67601

(and so on....)
QUESTION: How to get the space between the records and number two: How can I get *just* the city/state/zip on one line if possible? like this:
JCL
US Amercian MOrse
Lincoln, NB 67490

Is this possible please???

cmelnick
06-11-2003, 09:37 AM
It is absolutely possible.

For a space, you would just use an empty option:
Response.Write("<option value=0></option>")

and to get the City, State and Zip all on one line you would just put them all within the same option:

Response.Write("<option value=x>" & txtCity & ", " & txtstate & " " & txtZip & "</option>")