|
| |
|
|
yogaboy
Posts: 377 Joined: 5/22/2004 Status: offline
|
write from database to textbox - 11/1/2004 5:17:49
I want to fill out a form with fields from a database. I can get this to work - <input type="text" size="30" name="txtFirstName" maxlength="30" value="<% Response.write myRS("FirstName") %>"> but I want to use something like - <% document.Form.txtFirstName.value = myRS("FirstName") %> because then I can put all the writing in a big chunk at the top and it makes it neater and easier to fix/change. The problem is I get an error message when I do this - Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' I have 27 form fields, so I don't really want to use the first method, any ideas??? Iain
|
|
|
|
cliffdeen
Posts: 155 Joined: 4/12/2004 From: Mckinney, TX Status: offline
|
RE: write from database to textbox - 11/1/2004 22:05:42
well the easy way is to let frontpage and a drw do the work for you to retrieve the data. Once it is retrieved, insert a form within the data results region. Within the form, insert the text boxes/text areas. For each text box, define the field value you wish to have in that particular box. You can name the box anything but the initial value needs to be the equivalent of the field you want displayed there. In the value field - insert the field value in this format: <%=fp_FieldVal(fp_rs, "name of field goes here")%>. When the page is loaded, the connection is established via a web bot in frontpage and the values are loaded. Note, upon the original data retrieve, you will have the fields showing as <<field name>>. Once you have defined the text boxes with the code as described about you can remove all the <<field name>> references and just use the Fieldval names. Once the page is loaded your users can update those fields with new values and then using a post - you can send it to a update/confirm page where those items are reloaded into the db. If you don't want someone to update a particular field, then within frontpage - go to html view. find the line that has the text box value described and just place the word: "readonly" in front of the value statement. Hope this helps cliff
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|