Adressierung von Eingabefeldern über Index

Hi,
ist es möglich, Eingabefelder so zu definieren, dass ich sie über einen Index ansprechen kann?
Zwischenablage05

Yes, here is an inline example you can try to run through Yandex ...
Form Filler

Abe Getzler

Oct 2018

Background

Sample run

Designer

Blocks

Required_textboxes

When btnSubmit.Click

When lpkErrors.AfterPicking

Gallery Link

Other Projects

Background

This sample was coded in response to a request on the MIT AI2 help board:

https://groups.google.com/forum/#!msg/mitappinventortest/3p62239kUT0/5jg3TCr1AgAJ

The problem was how to manage a bunch of required text boxes, showing just the ones that were skipped.

Sample run

Here’s a sample form, at app startup. The text boxes come with prompts built in through the Designer. The second sample shows the form half way through me filling it out.

This is the response when I hit the Submit button prematurely, before filling these required fields. This is a List Picker, wired to send me to the appropriate text box based on which prompt I selected.

Sample form, filled in completely.

If accepted, all fields are cleared, and the ‘Errors’ button now says ‘Accepted’.

Designer

There are five text boxes for input, a Submit button, and a lpkErrors List Picker.

Blocks

Required_textboxes

This value procedure returns a list of all the required text box components that must be answered by the app user. This could not be a global variable’s init value, so we use a value procedure.

When btnSubmit.Click

This handles the Submit button click event.

First it clears a local list errors, then fills it with the Hints of text box components that had no text entered by the user.

If any errors were found, they are loaded into a List Picker, then the List Picker is opened.

Otherwise we announce that the form was accepted, and clear it.

(Because this is just a sample skeleton, we don’t save the data. This would be the place to do that.)

When lpkErrors.AfterPicking

Selecting from the list of error hints sends you into a search loop for the text box with that hint, forcing focus onto that text box to help you enter data into it.

Gallery Link

http://ai2.appinventor.mit.edu/?galleryId=6698050900852736

Other Projects