Repository: h2oai/wave
File: py/examples/textbox.py (Python)

Code before:
            ui.text(f'textbox_mask={q.args.textbox_mask}'),
            ui.text(f'textbox_icon={q.args.textbox_icon}'),
            ui.text(f'textbox_prefix={q.args.textbox_prefix}'),
            ui.text(f'textbox_suffix={q.args.textbox_suffix}'),
            ui.text(f'textbox_placeholder={q.args.textbox_placeholder}'),
            ui.text(f'textbox_disabled_placeholder={q.args.textbox_disabled_placeholder}'),
            ui.text(f'textbox_multiline={q.args.textbox_multiline}'),
            ui.text(f'textbox_trigger={q.args.textbox_trigger}'),
            ui.button(name='show_form', label='Back', primary=True),
        ]
    else:
        q.page['example'] = ui.form_card(box='1 1 4 10', items=[
            ui.textbox(name='textbox', label='Standard'),
            ui.textbox(name='textbox_disabled', label='Disabled', value='I am disabled', disabled=True),
            ui.textbox(name='textbox_readonly', label='Read-only', value='I am read-only', readonly=True),
            ui.textbox(name='textbox_required', label='Required', required=True),
            ui.textbox(name='textbox_error', label='With error message', error='I have an error'),
            ui.textbox(name='textbox_mask', label='With input mask', mask='(999) 999 - 9999'),
            ui.textbox(name='textbox_icon', label='With icon', icon='Calendar'),
            ui.textbox(name='textbox_prefix', label='With prefix', prefix='http://'),
            ui.textbox(name='textbox_suffix', label='With suffix', suffix='@h2o.ai'),
            ui.textbox(name='textbox_placeholder', label='With placeholder', placeholder='I need some input'),
            ui.textbox(name='textbox_disabled_placeholder', label='Disabled with placeholder', disabled=True,
                       placeholder='I am disabled'),
            ui.textbox(name='textbox_multiline', label='Multiline textarea', multiline=True),
            ui.textbox(name='textbox_trigger', label='Trigger', trigger=True),
            ui.button(name='show_inputs', label='Submit', primary=True),
        ])
    await q.page.save()


if __name__ == '__main__':
    listen('/demo', main)


Review comment (bug):
Better to make a new example file instead of modifying this one. 

An example that demonstrates how you can translate text as-you-type (which was the original intention of the issue).

e.g. a form with a `ui.textbox()` and a `ui.text()`, where the backend translates the textbox contents to [piglatin](https://stackoverflow.com/questions/51508664/python-pig-latin-converter-words-that-start-with-consonants) as you type and displays it in the text element.

Try to use a textarea (`multiline=True`).




Code after:
            ui.text(f'textbox_mask={q.args.textbox_mask}'),
            ui.text(f'textbox_icon={q.args.textbox_icon}'),
            ui.text(f'textbox_prefix={q.args.textbox_prefix}'),
            ui.text(f'textbox_suffix={q.args.textbox_suffix}'),
            ui.text(f'textbox_placeholder={q.args.textbox_placeholder}'),
            ui.text(f'textbox_disabled_placeholder={q.args.textbox_disabled_placeholder}'),
            ui.text(f'textbox_multiline={q.args.textbox_multiline}'),
            ui.button(name='show_form', label='Back', primary=True),
        ]
    else:
        q.page['example'] = ui.form_card(box='1 1 4 10', items=[
            ui.textbox(name='textbox', label='Standard'),
            ui.textbox(name='textbox_disabled', label='Disabled', value='I am disabled', disabled=True),
            ui.textbox(name='textbox_readonly', label='Read-only', value='I am read-only', readonly=True),
            ui.textbox(name='textbox_required', label='Required', required=True),
            ui.textbox(name='textbox_error', label='With error message', error='I have an error'),
            ui.textbox(name='textbox_mask', label='With input mask', mask='(999) 999 - 9999'),
            ui.textbox(name='textbox_icon', label='With icon', icon='Calendar'),
            ui.textbox(name='textbox_prefix', label='With prefix', prefix='http://'),
            ui.textbox(name='textbox_suffix', label='With suffix', suffix='@h2o.ai'),
            ui.textbox(name='textbox_placeholder', label='With placeholder', placeholder='I need some input'),
            ui.textbox(name='textbox_disabled_placeholder', label='Disabled with placeholder', disabled=True,
                       placeholder='I am disabled'),
            ui.textbox(name='textbox_multiline', label='Multiline textarea', multiline=True),
            ui.button(name='show_inputs', label='Submit', primary=True),
        ])
    await q.page.save()


if __name__ == '__main__':
    listen('/demo', main)