John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to give a Caption to an alert box?

Hi, in the simple JS code:

alert('message');

Image

I get the name.html of the page for the caption. How can i assign the caption in the JS?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How to give a Caption to an alert box?

Hi,

It should be something like this:

precode
Appery('mobileheader1').text('message');
/code/pre

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

How to give a Caption to an alert box?

im kinda confused. I dont want 'mobileheader_name' as my caption. I want to write my own caption other than the name of the page. The line you gave me does the same thing as before. Please give me a better example.

Ole Henrik Oftedal
Posts: 0
Joined: Thu Apr 19, 2012 4:52 pm

How to give a Caption to an alert box?

Hi!

I have the same problem, and I dont think this will help.

When we try to present the App on IPad i.e. for Apple reviewer we want to convince them that this is a real app. When we use Alert("Welcome to my app") we get the name of the page + .html in the dialogue.

Alert gives us the name of the html page in the title. This looks very bad on the screen :-(

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to give a Caption to an alert box?

Hi,

Create a special popup, which pulls out of localStorage Title and Message. Next, in JavaScript assets describe function my_alert (title, message) that records these variables in localStorage and calls popup. On popup place needed buttons (such as OK) that will close popup (maybe more).

With some effort, the very serious functionality can be implemented on such popup basis, not only alert, but also smart dialogue with Yes / No / Cancel / etc.

Ole Henrik Oftedal
Posts: 0
Joined: Thu Apr 19, 2012 4:52 pm

How to give a Caption to an alert box?

Ok. Thanks Katya!

Appery support is superior. Always leading us in the right directions :)

Introduce my_alert js function:

Image

Create a popup screen and name it popup1 with two components mobileheader1 and mobilelabel_3

On a button on the main form run this JavaScript:
my_alert('My Title','Hello and welcome to my App. This is a very very very long long text');

In Your JavaScript asset add this to new or any file
function my_alert(my_title,my_text)
{
localStorage.setItem('my_title', my_title);
localStorage.setItem('my_text', my_text);
Appery.navigateTo('popup1', {});
}

on popup1 Show event Add this JavaScript:
Appery('mobileheader1').text(localStorage.getItem('my_title'));
Appery('mobilelabel_3').text(localStorage.getItem('my_text'));

Robert Larsen
Posts: 0
Joined: Fri Aug 02, 2013 6:56 am

How to give a Caption to an alert box?

"In Your JavaScript asset add this to new or any file
function my_alert(my_title,my_text)
{
localStorage.setItem('my_title', my_title);
localStorage.setItem('my_text', my_text);
Appery.navigateTo('popup1', {});
} "

Im lost on this part.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How to give a Caption to an alert box?

Do you have question regarding adding code to JS asset or code itself?

Robert Larsen
Posts: 0
Joined: Fri Aug 02, 2013 6:56 am

How to give a Caption to an alert box?

Both, where in the JS asset do I place this, and do I place this in JS asset for the popup? And do I replace all (my_title) to whatever I would like my title to read?

Return to “Issues”