awayand Posted May 21, 2003 Posted May 21, 2003 Guys, I'm trying to put a field on my layout that is supposed to hold notes. I have a button on the layout that says: "Add comment". When a user hits that button, I want to insert text into the note field on top, with the current username, the date, and a ": ". Then the person should be able to type whatever he wants in there. My problem is that when I use the "insert" script text, the whole note field gets replaced. I guess my question is, how should I go about doing this? How do I avoid replacing text, and how do I make sure the text is inserted *before* all the other text that may already exist? Any ideas? Thanks!
bradm98 Posted May 21, 2003 Posted May 21, 2003 Try using: Set Field["Notes", UserName & " " & Status(CurrentDate) & ": <CR>" & Notes] where <CR> is the carriage return character. This will add the username and date at the beginning of the notes field, followed by existing notes on the second line. However, I don't believe this will preserve text formatting in the existing notes. You may want to experiment with cut and paste in that case.
EddyB Posted May 21, 2003 Posted May 21, 2003 Hi, Bradm98's post will almost work but the date will not be displayed correctly as our notes field will be formatted as text and so will not recognise Status(CurrentDate) correctly without converting it to text. Try this: SetField["TextField", Status( CurrentUserName) & " " & DateToText( Status( CurrentDate) ) & " : " & "
Recommended Posts
This topic is 7860 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now