I am trying to change the input type on an uber cartubercart checkout form using hook form alterhook_form_alter
. I added an extra field using the uc cart extra fields pane module but there is no option to add e-mail - only text - and I need the field I added to validate as an e-mail.
The field in question is:
<input type="text" id="edit-panes-billing-address-billing-ucxf-bill-to-email" name="panes[billing][address][billing_ucxf_bill_to_email]" value="" size="32" maxlength="255" class="form-text required">
<input type="text" id="edit-panes-billing-address-billing-ucxf-bill-to-email" name="panes[billing][address][billing_ucxf_bill_to_email]" value="" size="32" maxlength="255" class="form-text required">
The code I am using but with no sucesssuccess is:
function MYMODULE_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'uc-cart-checkout-form') { $form['panes-billing-address-billing-ucxf-bill-to-email'][LANGUAGE_NONE][0]['type'] = 'email';}
function MYMODULE_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'uc-cart-checkout-form') {
form['panes-billing-address-billing-ucxf-bill-to-email'][LANGUAGE_NONE][0]['type'] = 'email';
}
Thanks for any assistance!