1

I have a form with 3 steps using the Webform module. Is there a way for me to identify what step I'm in so I can style it separately? What I'm after is to place text like Step 1 > Step 2 > Step 3 while highlighting the current step using CSS.

So far, I can't find any ID or class which tells me what step I'm in.

EDIT: Not that important but any suggestions on how I can place the text Step 1 > Step 2 > Step 3? I was thinking of adding the text in body but maybe there's another/better way? Just curious.

3

Just add a fieldset around each step with the labels "step 1-3"

  • Oohhh, I feel so stupid...very, very stupid. :p – enchance Jun 26 '11 at 16:38
  • it's ok. sometimes we can't see the forest for the trees when working on a project. :) – user842 Jun 26 '11 at 17:12
0

You can also use variable_set to track your current step # and add increments as you go along...

if(variable_get('stepno')){

variable_set('stepno',variable_get('stepno')+1);
drupal_set_message('step: '.variable_get('stepno'));

} else { variable_set('stepno',1); drupal_set_message('Step 1'); }

0

At the edit side, you can rename the page break also, to keep track in the admin side what step you're editing — I'm using webforms 4 here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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