Submit
A submit format field is the equivalent of <input type="submit">, a submit button.
TerraForm recognises one special field for submit format. This is waitmessage. If the cf_terraform attribute HideButtonsOnSubmit is set to true then, when your form is submitted, your submit button will become disabled and replaced with a non-clickable button captioned with waitmessage.
The following two paragraphs refer to relatively advanced issues and techniques. Skip past them if they don't make sense.
The submit format works in unique ways, in part due to the limitations of HTML. When an button is submitted, the associated value submitted for the field is actually the caption of the button. Now, this is fine most of the time when we simply want to submit a form. In more complicated apps, however, we may have several buttons. A shopping cart, for example, may have, "Proceed to checkout," "Continue shopping," "Empty cart." In this case, your field might have the name "action," and the handling code would act based on the value of Form.Action. Many developers would prefer the actions bore no relation to the captions of the buttons. If the client says, "Please change 'Continue shopping' to 'Return to the shop'" then that's a cosmetic change. You shouldn't need to change the conditional code for your app.
Because of the limitation described above, TerraForm provides the following workaround, an implementation of a technique that many developers use. If you supply a value for a submit format field, then TerraForm assumes you want to use the workaround. The name of the submit field becomes, instead of the name attribute you supplied, [name].[value] . Your handler code will receive a form field like this: Form.[name].[value] = [caption] . Ideally, your application will include code to automatically split up couplets in this form, creating a new field called Form.[name] and giving it the value [value] . See the bottom of this page for more info.
Other non-TerraField attributes will be passed through to the underlying submit tag (<input type="submit">). For example:
disabledstyle="font-weight : bold"title="Push it"
The form below shows examples of a plain field, a field with a caption, and a field with a value. There are actually two forms on this page. The form above the rule has HideButtonsOnSubmit is set to true. The form below the rule has HideButtonsOnSubmit set to false.
Note: it is recommended that you do not give your submit field the name "submit". See "Common problems: submit() not defined when submitting a form using JavaScript" for an explanation.
