LiveCode LessonsLiveCode LessonsHow To - LiveCode Mobile TasksLiveCode Mobile TasksHow do I use the Question and Password Dialogues in LiveCode Mobile?

How do I use the Question and Password Dialogues in LiveCode Mobile?

This lesson describes how to use the LiveCode Question and Password Dialogues in iOS and Android. Source code and screen captures are provided.

Introduction

The Question and Password Dialogues provide simple pop up windows that allow you to prompt the user for the answer to a question or a password. The keyboard is raised at the same time as a dialogue is displayed. This allows the user to enter the required information.

Creating the Question Dialogue

Creating the Question Dialogue

The Question Dialogue is raised using the ask question syntax that is demonstrated in the following example:

ask question "What Time is it:" with "10:00" titled "Time Check"

Observe how the respective areas of the dialogue are populated with the values specified in the ask command. The default result is shown in the field.

Responding to the Question Dialogue

Responding to the Question Dialogue

Once the user enters an answer, the result is written to the variable it.

Creating the Password Dialogue

Creating the Password Dialogue

The Password Dialogue is raised using the ask password syntax that is demonstrated in the following example:

ask password "Please log in:" with "" titled "System Password"

The respective dialogue areas are populated in the same way for the Question Dialogue as for the Password Dialogue.

Responding to the Password Dialogue

Responding to the Password Dialogue

Once the user enters a password, black dots are displayed, indicating that characters have been entered. The result is written to the variable it.

3 Comments

Chipp Walters

Might also want to include what happens AFTER someone enters data and presses OK or Cancel:

if the result is "cancel" or it is empty then exit [handlerName]

put it into tTheAnswer

eythan

hello!
how can i edit the "answer" field?

Elanor Buchanan

Hi eythan

If you mean the answer dialog this is a system dialog so you can't modify it, at least on mobile. You could create a group you could show instead. If I have misunderstood your question please let me know.

Kind regards

Elanor

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.