Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

Use hook form lateralter to change input type

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!

Use hook form later to change input type

I am trying to change the input type on an uber cart checkout form using hook 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">

The code I am using but with no sucess 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';}

Thanks for any assistance!

Use hook form alter to change input type

I am trying to change the input type on an ubercart checkout form using hook_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">

The code I am using but with no success 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';
  }

Thanks for any assistance!

Source Link
penone
  • 341
  • 2
  • 13

Use hook form later to change input type

I am trying to change the input type on an uber cart checkout form using hook 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">

The code I am using but with no sucess 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';}

Thanks for any assistance!