New to Memento

136 views
Skip to first unread message

Ramesh

unread,
Oct 16, 2023, 6:43:11 AM10/16/23
to mementodatabase
Can we use JavaScript to populate date fields or any other fields (like Title, Radio Buttions) ? Are there any online articles available explaining the same?

Bill Crews

unread,
Oct 16, 2023, 12:23:00 PM10/16/23
to Ramesh, mementodatabase
In the Memento JavaScript Library (the MJL), you can use the set() method of the Entry object to set the value of a field. See the link to the wiki for this...
Also see the screenshot below.

Now, dates can be a bit tricky to deal with. The basic way dates & times are stored is in milliseconds since Jan 1 1970. However, when creating a Date object, one can create it with other units. See this link for how to do that...

Now, for when to set the field value, you can do this using a Memento action, trigger, or a Button field. See the MJL pages "Actions", "Triggers", and "Trigger Examples" under Scripting in the wiki. I don't recall if the MJL contains info on a Button field or not. Look and see. If not, there might be mention of it in Memento Help, but I doubt it.

Now in the Triggers wiki page, see how to set trigger parameters -- mainly Event and Phase. Before Memento began to offer Prefilled fields, we used to use trigger Event Opening an entry view or entry card for this. You still can do that, and I don't know how to tell you to use prefilled fields.


On Mon, Oct 16, 2023, 6:43 AM Ramesh <ume9...@gmail.com> wrote:
Can we use JavaScript to populate date fields or any other fields (like Title, Radio Buttions) ? Are there any online articles available explaining the same?

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/28af949c-6413-4a2c-a321-bfea540f8543n%40googlegroups.com.
Screenshot_20231016_120613_Firefox.jpg
Reply all
Reply to author
Forward
0 new messages