Gossamer Forum
Home : Products : DBMan SQL : Discussion :

timestamp new text

Quote Reply
timestamp new text
Hi,

I have a textarea where users input case history. I have setup the field so that users can only add new data to the textarea; however, they cannot modify previously added data. I want to add a timestamp each time a user enters data into the field and I've tried to accomplish that with the following code:

<TEXTAREA name=casehistory rows=14 cols=77></TEXTAREA> # this takes in the new case history

<INPUT type=hidden name=casehistory value="<%casehistory%>"> # this takes in the previous case history

<INPUT type=hidden name=casehistory value="<hr>Added By: <%Username%> on <%get_date(casehistory)%> @ <%get_time(casehistory)%><br><hr>"> # this is the timestamp



The problem I'm having is the timestamp will sometime get displayed above the newly added case history or at the very top of all the case history. I've tried switching the order of the input fields around, but that made a difference sometimes, but there are still times when it doesn't work. I was wondering if there is any other way to do this?






Reena
Quote Reply
Re: [Reena0330] timestamp new text In reply to
I was thinking perhaps I could have a casehistory field and a timestamp field and before the record is added concatenate the two fields into the casehistory field. Any ideas how this might be done?
Reena
Quote Reply
Re: [Reena0330] timestamp new text In reply to
I'm not sure how you'd accomplish that with perl, but I've had success concatenating form fields with javascript. You just write a short function with something like the following:

Code:


function concat_submit() {
document.formname.fullfieldname.value = (document.formname.fieldonename.value + document.formname.fieldtwoname.value);
document.formname.submit();

}


Then your submit button becomes:

<input type="button" name="submit" onclick="javascript:concat_submit();">

I think something like that should work, although my javascripting isn't always too hot...

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund