0

I am working with webform module , I have added two different forms in my website.
I have customized the forms according to my convenience, as I have changed the css. These changes are reflected in the two forms.
Now i need to get the id of these forms so i can further customize one of them.
I have added this css code for form

.form-text,
.form-textarea {
   width: 100%;
}
  • 3
    ues firebug addon on firefox to find the id of your form – Bala Feb 20 '14 at 6:57
2

Try the Get Form ID module:

By hovering over any form you will see a contextual link available. By expanding the link you will see the form ID. Click on the link and you will see a modal window with copyable form id and hook_form_FORM_ID_alter() hook suggestion.

Step 1: hover over the form.

enter image description here

Step 2: expanding the contextual link. enter image description here

Step 3: Click on the link and a new window will open with copyable form id and hook_form_FORM_ID_alter() hook suggestion

enter image description here

|improve this answer|||||
1

You can get the form id from the form_id hidden field of the webform. Go to source view of the form from your browser and search for form_id.

|improve this answer|||||
1

Just another method. If you use Devel module, you can add this code snippet to your custom module to view the form id.

function [module_name]_form_alter(&$form, &$form_state, $form_id){
  dpm($form_id);
}
|improve this answer|||||
1

You can use firebug

  • Just right click the FORM using Chrome Browser and click Inspect Element

    enter image description here

  • Select form tag, you can see the FORM ID inside ID attribute

    enter image description here

|improve this answer|||||
0

Webform forms usually have the id webform_client_form_nid. Where nid is your node id.

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.