Retaining the contents of a Textbox

Results 1 to 2 of 2

Thread: Retaining the contents of a Textbox

  1. #1
    Join Date
    Dec 1969

    Default Retaining the contents of a Textbox

    have 2 textboxes comments and prior comments as part of a form.<BR>The Comments box is for entering infor<BR>The Prior comments is to hold the contents of the infor entered from the comments field. it is therefore just a read only field.<BR>When the form is updated the comments fields is cleared off and the infor inserted in the prior comments field.<BR><BR>If for the same record another infor is entered into comments field the prior comments filed should retain the inital infor as well as the new infor.<BR>The actual code needed to make this work wil be very much appreciated. thank you<BR>I am using ASp script with a Access Database Background

  2. #2
    Join Date
    Dec 1969

    Default LOL! This is *EXACTLY*...

    ...what "Trippy" was doing last night! A *VERY VERY* long thread on the subject if you will just click on "See post from 4/25/2004" in the top of this section of that page.<BR><BR>Trippy couldn&#039;t figure out how to get it to work except with a hack, but that&#039;s partly because she is using VB controls instead of ordinary ASP/VBS code.<BR><BR>Several ways to do this.<BR><BR>Say your form looks like this:<BR><BR>&#060;TEXTAREA Name="PriorComments" READONLY&#062;&#060;%=RS("comments")%&#062;&#060;/TEXTAREA&#062;<BR>&#060;TEXTAREA Name="NewComments"&#062;&#060;/TEXTAREA&#062;<BR><BR>Then on the page that process the form you just do:<BR><BR>&#060;%<BR>newcomments = Replace( Request("NewComments"), "&#039;", "&#039;&#039;" )<BR>SQL = "UPDATE yourTable SET comments = comments & &#039;" & newcomments & "&#039;" _<BR> & " WHERE id = " & idForThisRecord<BR>conn.Execute SQL<BR>%&#062;<BR><BR>See the idea? You just use SQL to *append* the new comments to the comments that are already there.<BR><BR>Simple.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts