The ResetButton control is typically used together with a SubmitBotton, to clear all
input fields in a form like the one below. However, if the form was loaded with
values already being set, those values will be returned when the ResetButton is clicked.
:Class ResetButtonSimple : MiPageSample
⍝
⍝
:Field Public fname←''
:Field Public lname←''
∇ Compose;frm;field;prompt;value;fieldset;hello;inputs
:Access Public
Add _.style'#Reset {font-weight: bold; font-size: large;}'
:If _Request.Method≡'get' ⍝
fname←lname←''
:EndIf
Add _.p ScriptFollows
⍝
⍝
⍝
frm←Add _.Form
fieldset←frm.Add _.Fieldset'Personalia:' ⍝
inputs←fieldset.Add _.InputGrid
inputs.Labels←'First Name:' 'Last Name:'
inputs.Inputs←{⍵ New _.EditField ⍵(⍎⍵)}¨'fname' 'lname'
Add _.br
'Submit'frm.Add _.SubmitButton'Submit'
'Reset'frm.Add _.ResetButton'Reset'
:If 0≠⍴fname,lname ⋄ hello←' +!'⎕R'!'⊢'Hello, ',fname,' ',lname,'!'
:Else ⋄ hello←'' ⋄ :EndIf
'output'Add _.div hello
∇
:EndClass