m (E00a555c-1e5d-4eb3-b26b-5be8dc16c657 moved page DevOps:Doc/FlexForm/1.0.0/input/submit to input/submit without leaving a redirect: Text replacement - "1.0.0" to "1.0")
 
(5 intermediate revisions by 4 users not shown)
Line 9: Line 9:
  
 
_input elements of type "'''submit'''" are rendered as buttons. When the click event occurs (typically because the user clicked the button), the user agent attempts to submit the form to the server.  
 
_input elements of type "'''submit'''" are rendered as buttons. When the click event occurs (typically because the user clicked the button), the user agent attempts to submit the form to the server.  
 +
 +
<code>mwpausebeforerefresh</code> can be added to a submit button, to make FlexForm wait a specified number of seconds before refreshing a page after completing form actions. See example 3.
  
 
FlexForm has several ways to submit form.  
 
FlexForm has several ways to submit form.  
Line 19: Line 21:
  
 
Meaning the user will stay on the page without the need to reload a page. This can be very handy if a page has several FlexForms that do various tasks.
 
Meaning the user will stay on the page without the need to reload a page. This can be very handy if a page has several FlexForms that do various tasks.
 +
 
===Parameters===
 
===Parameters===
 
_input type="submit"
 
_input type="submit"
Line 32: Line 35:
 
<syntaxhighlight lang="html">
 
<syntaxhighlight lang="html">
 
<_input type="submit" value="Send Request" mwidentifier="ajax" />
 
<_input type="submit" value="Send Request" mwidentifier="ajax" />
 +
</syntaxhighlight>
 +
Example 3
 +
<syntaxhighlight lang="html">
 +
<_input type="submit" mwpausebeforerefresh="2"/>
 
</syntaxhighlight>
 
</syntaxhighlight>
 
===Note===
 
===Note===
ws-class-props
Line 1: Line 1:
 
+
{{Doc properties
 +
|Doc subject=DevOps:Doc/FlexForm
 +
|Subject version=1.0,1.1
 +
|Doc parent=DevOps:Doc/FlexForm/1.0/input
 +
|Doc sort order=110
 +
|Doc target group=User
 +
|Doc synopsis=How to submit a form
 +
}}
ws-page-props
Line 1: Line 1:
{{Doc properties
+
 
|Doc subject=DevOps:Doc/FlexForm
 
|Doc parent=DevOps:Doc/FlexForm/1.0.0/input
 
|Doc sort order=110
 
|Doc target group=User
 
|Subject version=1.0.0
 
}}
 

Latest revision as of 11:54, 22 November 2022

Name

submit

Type

_input

Synopsis

How to submit a form

Description

To have a form send to the handler it must have a submit button.

_input elements of type "submit" are rendered as buttons. When the click event occurs (typically because the user clicked the button), the user agent attempts to submit the form to the server.

mwpausebeforerefresh can be added to a submit button, to make FlexForm wait a specified number of seconds before refreshing a page after completing form actions. See example 3.

FlexForm has several ways to submit form.

Example 1 is the traditional way

A user clicks the submit button and the page refreshes or, depending on the form settings, brings the user to e.g. a thank you page.

Example 2 is submitting a Form using Ajax

Meaning the user will stay on the page without the need to reload a page. This can be very handy if a page has several FlexForms that do various tasks.

Parameters

_input type="submit"

All other arguments like "class" "id" etc are allowed

Example

Example 1

<_input type="submit" value="Send Request" />

Example 2

<_input type="submit" value="Send Request" mwidentifier="ajax" />

Example 3

<_input type="submit" mwpausebeforerefresh="2"/>

Note

When a user clicks on a submit button. FlexForm disables the button (to prevent clicking more than once), will add a class of "wsform-submitting" to the form while it is being submitted and will add a class "wsform-submitted" when it is done (this last class is only relevant for ajax submit).

Links

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/submit