08-14-2002, 11:27 AM
Hi, I just started learning asp recently and I'm only able to do the most basic things....like write the contents of a form into a database and output the results onto another page. This is my problem:
I am able write data from a form into a database on page#1. I am able to output the contents of that form on page#2. But I also need to output those contents into a hidden form on page#2.
So I guess my question is: can you read data from a database into a form ? And if you can please tell me how!! Thanks!
so you know how to get the data out off your database and puth them into a recordset.
To insert this data into a form, just create your form, and replace the value's with the one from your recordset.
<input id="text1" maxlength="50" name="name" size="40" type="text" value='<%response.write(rsClients.Fields("name"))%>'></td>
As you can see, it's quite simple.
08-14-2002, 01:18 PM
Thank you, I'll try it and see if it works.
I was trying a similar method but it didn't work. The output on
page#2 uses lines like this:
But when I tried to put those lines in the form it didn't work:
<input id="text1" maxlength="50" name="name" size="40" type="text" value='<%=FP_FieldVal(fp_rs,"name")%>'>
no problem. (By the way, I use VBScript)
below is some code to generate a listbox, based on the data in your recordset (one option for each record)
do while rsClients.EOF=false
' comment : normale html code: <option value=12> test </option>
Response.Write("<option value=" & rsSoort.Fields("clientID")& ">")
Response.Write(server.HTMLEncode(rsSoort.Fields("name")) & "</option>")
'server.htmlencode converts all text into html code
It's always the same principle. Just replace the values you would insert manuely, by a value from your recordset.