Hi
I have the following problem. I have a table containing many records linked to a person. When this person (table a) looks at his page it is displayed questions that belongs to him (table b).
The goal of this page is to update the changes he makes to these records and insert the date he made the changes to these records.
Example:
Peter has these records attaches to him:
1. question - answer value 1 - no date
2. question - answer value 1 - no date
3. question - answer value 4 - 11-12-2009
4. question - answer value 3 - 09-12-2009
5. question - answer value 2 - 02-12-2009
Now, if Peter changes the answer value of question 2, 3 and 4 I want to update only question 2, 3 and 4 since these are the records where the value changes. This means that question 2,3 and 4 changes the answer value from a drop down menu and that these questions are updated with the date of today.
I have (in my newbie world ) landed on a solution I think might work. I have a multiple update function that works, but it updates all the records in the repeated region but does not update the date field in the recordset.
I thought it might be possible to have a hidden field with the value from the form element witch represents the answer field in the recordset. Then I have a hidden field with the "original" value of the answer field - then I could have an if condition that is based on if the original value is equal the form value sent then do not update and if the original value is not equal to the form value then update record and update with date.
Is this possible or is there an easier way?
I have tried to write an if sentence that does not work and it looks something like this:
<%
if (Request.Form("orig_value"
)) < > (Request.Form("new_value_c
ount")) Then %>
<input type="hidden" id="new_alter_value" value="Request.Form("new_v
alue_count
")" />
<% End if %>
<%
if (Request.Form("orig_value"
)) = (Request.Form("new_value_c
ount")) Then %>
<input type="hidden" id="donotsend" value="" />
<% End if %>
In the update part of my asp page I have chosen to update the recordset with the fields that have the id="new_alter_value" and update the date fields altso
I am quite desperate now and been working late night hours, so I am sorry for bad english and bad logic.
Any help will be great help.
Thanks in advance.
PS. I am using asp vbscript and a mssql 2005 database.