Skip to content

Commit

Permalink
FIX: Contact ID in Contact Edit was Preventing Form Submission
Browse files Browse the repository at this point in the history
- Fixes 5ae8989
- Manually build input for Contact ID - exclude `name` attribute to be excluded from form submission
- Contact ID is displayed on the form for user experience only and not for form submission
  • Loading branch information
aljawaid committed Jul 1, 2023
1 parent 37341e8 commit fa345ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Template/contact/edit.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php $fields = count($headings); ?>
<?php $fields = count($headings) ?>

<?php if ($fields < 3): ?>
<style type="text/css">
Expand Down Expand Up @@ -52,8 +52,9 @@
<?= $this->form->csrf() ?>

<div class="form-group contact-id">
<?= $this->form->label(t('Contact ID'), $contacts_id . '__' . 'ContactID') ?>
<?= $this->form->text($contacts_id . '__' . 'ContactID', array(), array(), array('value="' . $contacts_id . '"', 'readonly'), 'property-input property-input-disabled') ?>
<?= $this->form->label(t('Contact ID'), 'ContactID') ?>
<!-- Manually build input for Contact ID - exclude `name` attribute to be excluded from form submission -->
<input id="form-ContactID" type="text" class="property-input property-input-disabled" value="<?= $contacts_id ?>" placeholder="" readonly="readonly">
</div>

<?php foreach ($headings as $key => $value): ?>
Expand Down

0 comments on commit fa345ba

Please sign in to comment.