Form: Difference between revisions
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
|- | |- | ||
| openMode || Should the form be open at startup? Classic framework only. | | openMode || Should the form be open at startup? Classic framework only. | ||
|- | |||
| style || The CSS style for the form. Will override the background. <pre>background: -webkit-gradient(linear, left top, left bottom, from(#55aaee), to(#003366));</pre> | |||
|- | |- | ||
| Url || The URL to be called when the form is submitted using the submit() function. | | Url || The URL to be called when the form is submitted using the submit() function. |
Revision as of 16:26, 13 February 2013
Description
Forms act as containers for controls. To go to a new form, use the ChangeForm() function.
To add a Form to your app, choose Add Form from the Project menu at the top of the screen. Forms can be deleted in the Project Explorer.
The information on a form can be submitted to a URL by calling the form.submit() function. The values for all controls on the form which have their Name property defined will be appended to the URL as an HTML query string.
Properties
Standard properties are supported, plus:
height | The height of the form. Default is 460 pixels. |
left | The left position of the form. Use this for forms that are not full screen. |
method | Get or Post. The method that the http form is sent by. |
openMode | Should the form be open at startup? Classic framework only. |
style | The CSS style for the form. Will override the background. background: -webkit-gradient(linear, left top, left bottom, from(#55aaee), to(#003366)); |
Url | The URL to be called when the form is submitted using the submit() function. |
width | The width of the form. Default is 320 pixels. |
reset() | Clear all fields on the form. Runtime only. |
submit() | Submit the data on the form to the specified URL. Runtime only. See Location as well. |
Events
Standard events are supported, plus:
onhide() | Called when form hidden as a result of ChangeForm() |
onkeypress(e) | Called when a key is tapped on a form. |
onshow() | Called by firstform and when form is shown as a result of ChangeForm. |
onsubmit() | Called when a form is submitted. |
Example
Function btnSendData_onclick() Form1.submit() End Function
To prevent a form from being submitted when the return key is entered in a field:
Function Form1_onsubmit() window.event.cancelBubble=True window.event.returnValue=False End Function
Output
(Url is called with values in the query string)