Here's the form itself — the input fields, the validation, the layout.
This is the input block itself — the fields, the validation, the footer buttons. Trimmed to the fields that matter:
<block> <form type="form" id="addcontactform" name="addcontactform" app="bcforms" submod="insertcontact"> <div class="modal-body"> <table id="ft1" class="table"> <tr> <td> <label for="contact_name">Name *</label> <input id="contact_name" name="contact_name" placeholder="Full name" mandatory="Name is required" /> </td> </tr> <tr> <td> <label for="email">Email *</label> <input id="email" name="email" placeholder="Email address" mandatory="Email is required" /> </td> </tr> <!-- department, job_title, phone follow the same pattern --> </table> </div> <!-- Footer inside the form, so validation and submit stay wired --> <div class="modal-footer"> <button type="button" class="btn-ghost" onclick="bcModal.close('bcmodaloverlay')">Cancel</button> <button type="submit" class="btn-primary">Save Contact</button> </div> </form> </block>
<block>, with a real <form> nested inside — same rule as every other block file in this arc.setup…() call — is gone. The engine derives all of it from id= and submod= and generates the submit handler itself.numeric=, date=, alpha=, mask= and chkfld= work the same way.<input type="hidden">, as the edit form below does with contact_id.Updating one is different — the form needs to display the current record before anything can be changed. That's where a form's own SQL block comes in, and the same applies to any form that needs to show existing data, not just this one.
<block> <!-- Prefill first: runs before the form renders, so every field opens filled --> <sql> <query name="contact_prefill"><![CDATA[ SELECT contact_name, email, department, phone FROM contacts WHERE contact_id = '%contact_id%' AND dept_id = '%deptid%' LIMIT 1 ]]></query> </sql> <form type="form" id="editcontactform" name="editcontactform" app="bcforms" submod="updatecontact"> <input type="hidden" name="contact_id" value="%contact_id%" /> <div class="modal-body"> <table id="ft1" class="table"> <tr> <td> <label for="contact_name">Name *</label> <input id="contact_name" name="contact_name" value="%contact_name%" mandatory="Name is required" /> </td> </tr> <tr> <td> <label for="email">Email *</label> <input id="email" name="email" value="%email%" mandatory="Email is required" /> </td> </tr> <!-- department and phone follow the same pattern, each pre-filled with its own %token% --> </table> </div> <div class="modal-footer"> <button type="button" class="btn-ghost" onclick="bcModal.close('bcmodaloverlay')">Cancel</button> <button type="submit" class="btn-primary">Save Changes</button> </div> </form> </block>