javascript to pop up message to user

455 views
Skip to first unread message

mohamed

unread,
Dec 4, 2023, 3:13:01 PM12/4/23
to mementodatabase
hi ,
i need help  to make action script to pop up message to user and the message not disapear only if user press ok 

thanks 

Er Mo

unread,
Dec 4, 2023, 3:23:54 PM12/4/23
to mementodatabase
Hallo
Das wird Schwierig . In der PC Version muss man die message() bestätigen , in der Mobil Version nicht. Man kann aber keinen Einfluss darauf nehmen um was zu ändern . Ein Ausweg wäre vielleicht über SMS oder E Mail . Oder man versucht in Wigets was zu basteln .

Hello
This will be difficult. In the PC version you have to confirm the message(), in the mobile version you don't. But you can't influence it to change anything. A way out might be via SMS or email. Or you can try to make something in Wigets.

Ernst

mohamed

unread,
Dec 5, 2023, 1:46:24 AM12/5/23
to mementodatabase
thank you for yor response

David Gilmore

unread,
Dec 19, 2023, 12:06:25 PM12/19/23
to mementodatabase
I have been looking for doing this with a Toast (or message) myself, and finally came up with a method for having longer Toast messages, and keeping the Toast visible until dismissed by the user. This is what I did:

Create a library called "Toast" with two fields, "Name" (type Text) and "Text" (type Rich Text). Uncheck the "Text" field's "Display the name of the field in the card entry". Then create 4 entries, with Names of "Error", "Warning", "Help", and "Info" (these are the basic "Toast" types, you can add additional ones). You can leave the "Text" field blank.

In the library or libraries that you want to make Toasts, add the following "Shared" script (function):

function Toast(stext, stype) {
  stext = stext + "<p><small>Press back to close.</small>";
  var v = libByName("Toast").find(stype);
  if (v != null) {
    if (v.length > 0) {
      var p = v[0];
      p.set("Text", stext);
      p.show();
      exit();
    }
  }
  message("Invalid Toast type");
}

Be sure to set the option for this function to allow access of external libraries.

Now when you want to make a toast, simply call the function Toast in your script:

Toast("This was a <b>serious</b> error.<p>You should be ashamed.", "Error");

The user will be instructed to press back to close this toast and return to his current screen.

Note that you can use HTML tags to format the toast.

mohamed

unread,
Dec 23, 2023, 11:33:20 AM12/23/23
to mementodatabase
Thank you very much for your brilliant solution

Michail

unread,
Dec 28, 2023, 12:50:10 PM12/28/23
to mementodatabase
Ждем от автора программы метод field(name).show(). Это позволит решить все вопросы со всплывающими окнами. Прошу создать тему в UserVoice и сбросить ссылку сюда. С удовольствием проголосую...

суббота, 23 декабря 2023 г. в 19:33:20 UTC+3, mohamed:
Reply all
Reply to author
Forward
0 new messages