Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display and update data?

Status
Not open for further replies.

belcom125

Programmer
Nov 17, 2004
45
CA
need some help to figure out how to display existing data for a particular record in Form fields and if changed in the field I need to click update button which will update the changed fields in the database, or maybe all because the ones that weren't changed gonna stay the sane anyway. what's the best solution for this?
 
The method of displaying existing data on an update form will depend on which type HTML <input> element you are using.

For regular textboxes you can do something like this:
Code:
<input type='text' name='foo' value='<%= rs("foo") %>'>

For radio buttons or checkboxes:
Code:
<%input type='radio' name='foo' <%IF cBool(rs("foo")) THEN Response.Write "checked" %>>

For dropdown select boxes:
Code:
<select name='foo'>
  <option value="1" <%IF rs("foo") = "1") THEN Response.Write "selected"%>>First</option>
  <option value="2" <%IF rs("foo") = "2") THEN Response.Write "selected"%>>Second</option>
  <option value="3" <%IF rs("foo") = "3") THEN Response.Write "selected"%>>Third</option>
</select>

For text area:
Code:
<textarea name='foo'><%= rs("foo")%></textarea>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top