ZC 1.5.6a (with files from Github for pending 1.5.6b)
So I noticed forms like Login or Contact Us forms are converted to HTML5 style with the error popped up in the field instead of "Error Stacks" after submit the form.
However, the website has one customized form, which collect customer data for rental process.
I noticed on HTML part of the form... there are differences between the old HTML vs new HTML5 forms (using example from Contact Us form).
Old HTML:
HTML Code:
<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label class="inputLabel" for="phonenumber"><?php echo ENTRY_PHONE; ?></label>
<?php echo zen_draw_input_field('phonenumber', $phone, ' size="40" id="phonenumber"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($email_address), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label for="enquiry"><?php echo ENTRY_ENQUIRY . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', $enquiry, 'id="enquiry"'); ?>
New HTML5 Form:
HTML Code:
<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'); ?>
<br class="clearBoth" />
<label class="inputLabel" for="phonenumber"><?php echo ENTRY_PHONE; ?></label>
<?php echo zen_draw_input_field('phonenumber', $phone, ' size="40" id="phonenumber" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'); ?>
<br class="clearBoth" />
<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($email_address), ' size="40" id="email-address" autocomplete="off" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required', 'email'); ?>
<br class="clearBoth" />
<label for="enquiry"><?php echo ENTRY_ENQUIRY; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', $enquiry, 'id="enquiry" placeholder="' . ENTRY_REQUIRED_SYMBOL . '" required'); ?>
I do wonder all I need is to change the HTML part of the form (presumed at "includes\templates\custom\templates\tpl_custom_form_default.php") or I need to do on other parts like in CSS and possibly on JavaScript part as well? (Surely codes are already with Zen Cart's core files. I'm simply wonder if I have to do manual import to custom forms.)
Bookmarks