A <textarea> is populated by PHP from MySQL db. The user can edit text and will doubtless hit the enter key at some stage. I wanted to give user option of inserting a time stamp for each edit. I thought JScript could repopulate <txtarea> with value and time stamp:
eg. onclick="javascript:document.form1.name.value='<? echo $aval_plus_timestamp; ?>'"
HOwever, when the user hits the enter key, an evil js error screen rears ugly head with "unterminated string" or the like. \n\r must be breaking up the js code or something? I don't see how nl2br et al can help here?
Can anybody:
- Suggest a work around
- Better still - a neet way of inserting a time stamp, but only when user makes modification or requests it
M.