
Originally Posted by
rbarbour
I've been doing some research and adding the "required" indicator to the inputs placeholder is becoming increasingly popular and it is cross browser supported. This of course excludes selects, radio and check-boxes.
Surprisingly IMO, it actually looks really nice and eliminates the line breaks on smaller devices.
So I've worked out how to do this in tel_contact_us_default.php:
Code:
<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"'); ?>
<br class="clearBoth" />
But for the other files that have required fields I'm stuck. e.g. in tpl_modules_create_account.php:
Code:
<label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME; ?></label>
<?php echo zen_draw_input_field('firstname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
If I do the following:
Code:
<label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></label>
<?php echo zen_draw_input_field('firstname', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname"') : ''); ?>
<br class="clearBoth" />
it breaks the form and nothing is displayed.
My PHP and HTML knowledge was good enough to make my own template for use in 1.3.x and up, but I'm stuck now!
Andy