By weblinq on
I want to use the theme_radio to style a radio button for one specific form.
I used phptemplate_theme_radio in the template.php file, but now all the forms are changed. How can I change only one specific form?
I want to use the theme_radio to style a radio button for one specific form.
I used phptemplate_theme_radio in the template.php file, but now all the forms are changed. How can I change only one specific form?
Comments
Can some one help me please,
Can some one help me please, I only what to add some custom html tags arround the radio options for just one specific form not all
There is a way...
Have a look into hook_form_FORM_ID_alter details at http://api.drupal.org/api/function/hook_form_FORM_ID_alter/6.
This allows you to apply changes to only one form (based on the form_id) and not every form on your system which is what you're after I think.
Yes I know this function, but
Yes I know this function, but the form I need to style is an ubercart product order form and this form is rendered as:
uc_product_add_to_cart-NID so for node 14 the formid is uc_product_add_to_cart_14 and for node 16 the formid is uc_product_add_to_cart_16 etc.
So I have used the function:
function uc_kleurwaaier_form_alter(&$form, $form_state, $form_id) {
if (substr($form_id, 0, 27) == 'uc_product_add_to_cart_form') {
// 1. HERE MUST COME THE ADJUSTMENST TO THE FORM ELEMENTS
}
}
What do I need to add on position 1 to add div arround a form option for example?
Thx!