MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / textarea

Function textarea

pywebio/input.py:271–307  ·  view source on GitHub ↗

r"""Text input area (multi-line text input) :param int rows: The number of visible text lines for the input area. Scroll bar will be used when content exceeds. :param int maxlength: The maximum number of characters (UTF-16 code units) that the user can enter. If this value isn't spe

(label: str = '', *, rows: int = 6, code: Union[bool, Dict] = None, maxlength: int = None,
             minlength: int = None,
             validate: Callable[[Any], Optional[str]] = None, name: str = None, value: str = None,
             onchange: Callable[[Any], None] = None,
             placeholder: str = None, required: bool = None, readonly: bool = None, help_text: str = None,
             **other_html_attrs)

Source from the content-addressed store, hash-verified

269
270
271def textarea(label: str = '', *, rows: int = 6, code: Union[bool, Dict] = None, maxlength: int = None,
272 minlength: int = None,
273 validate: Callable[[Any], Optional[str]] = None, name: str = None, value: str = None,
274 onchange: Callable[[Any], None] = None,
275 placeholder: str = None, required: bool = None, readonly: bool = None, help_text: str = None,
276 **other_html_attrs):
277 r"""Text input area (multi-line text input)
278
279 :param int rows: The number of visible text lines for the input area. Scroll bar will be used when content exceeds.
280 :param int maxlength: The maximum number of characters (UTF-16 code units) that the user can enter.
281 If this value isn't specified, the user can enter an unlimited number of characters.
282 :param int minlength: The minimum number of characters (UTF-16 code units) required that the user should enter.
283 :param dict/bool code: Enable a code style editor by providing the `Codemirror <https://codemirror.net/>`_ options:
284
285 .. exportable-codeblock::
286 :name: textarea-code
287 :summary: `textarea()` code editor style
288
289 res = textarea('Text area', code={
290 'mode': "python",
291 'theme': 'darcula'
292 })
293 put_code(res, language='python') # ..demo-only
294
295 You can simply use ``code={}`` or ``code=True`` to enable code style editor.
296 You can use ``Esc`` or ``F11`` to toggle fullscreen of code style textarea.
297
298 Some commonly used Codemirror options are listed :ref:`here <codemirror_options>`.
299
300 :param - label, validate, name, value, onchange, placeholder, required, readonly, help_text, other_html_attrs:
301 Those arguments have the same meaning as for `input()`
302 :return: The string value that user input.
303 """
304 item_spec, valid_func, onchange_func = _parse_args(locals())
305 item_spec['type'] = TEXTAREA
306
307 return single_input(item_spec, valid_func, lambda d: d, onchange_func)
308
309
310def _parse_select_options(options):

Callers 6

put_textareaFunction · 0.90
basic_inputFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
formFunction · 0.85
mainFunction · 0.85

Calls 2

_parse_argsFunction · 0.85
single_inputFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…