dcf.Form
The
<dcf.Form>
tag inserts a form onto a page.
Attributes
- AlwaysNew: TODO
- RecordOrder: TODO
Children Tags and Attributes
dc.Panel
Defines a section of the form
- Title: Display Title for the section
Input
- placeholder: greyed out text displayed in input box
- Name: assigned variable to input for later reference
- Required: Boolean value that determines whether submitting can process when value is blank
- Label: text displayed before input box
dcf.FormButtons
dcf.SubmitButton
Usage Notes
Save Record: special function to run with submit button is clicked
<Function Name="SaveRecord" Params="e">
var page = this;
let x = e.Data
x.UUID = ""
e.Wait = true
dc.comm.call('flwServices.Tracking.Transform', x , function(resp) {
if (resp.Code > 0) {
dc.pui.Popup.alert(resp.Message);
}
else {
dc.pui.Popup.alert(resp.Result.SiteMark);
}
});
</Function>
LoadRecord: can reference variables for form on page load
<Function Name="LoadRecord" Params="e">
var page = this;
e.Data.First = "Test"
e.Data.Last = "Person"
e.Data.Email = "email@email.com"
</Function>
Examples
<dc.SimpleLayout Pad="Large">
<h1>PatientRegistration</h1>
<br />
<dc.Callout id="instructions">
<h2>Instructions</h2>
<p>Complete the secure online registration form below.</p>
</dc.Callout>
<dcf.Form AlwaysNew="true" RecordOrder="Registration,Payee,MedicalOne,MedicalTwo,DentalOne,DentalTwo,EmergencyContact,History,Certification,Access,Pandemic,Default">
<dc.Panel id="panSummary" Title="Patient Registration" class="option-panel">
<dcf.MultiText Label="Legal Name">
<Input placeholder="First" Name="PatientFirst" Required="true" maxlength="22" Size="40" />
<Input placeholder="Last" Name="PatientLast" Required="true" maxlength="22" Size="40" />
<Input placeholder="MI" Name="PatientMI" maxlength="2" Record="Registration" Size="10" />
</dcf.MultiText>
</dc.Panel>
[...]
<dc.Panel id="panSubmit" Title="Submit Forms" class="option-panel">
<p>Once all the above forms have been completed as necessary, please submit them all using this button.</p>
<dcf.FormButtons>
<dcf.SubmitCaptchaButton Action="submit_registration" Label="Submit" />
</dcf.FormButtons>
</dc.Panel>
</dcf.Form>
</dc.SimpleLayout>
``` xml
<dcf.Form>
<dc.Panel id="contactInput" Title="Contact Information" class="option-panel">
<dcf.Text Label="First Name" placeholder="First Name" Name="First" Required="true" />
<dcf.Text Label="Last Name" placeholder="Last Name" Name="Last" Required="true" />
<dcf.Text Label="Email Address" placeholder="Email Address" Name="Email" DataType="dcEmail" Required="true"/>
<dcf.FormButtons>
<dcf.SubmitButton Label="Submit" />
</dcf.FormButtons>
</dc.Panel>
</dcf.Form>