FormBuilder Using a Pulldown from UDT Topic is solved

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

FormBuilder Using a Pulldown from UDT

Post by webform »

Is there a clever way i can get a Pulldown in FormBuilder without manually have to create all the +100 Pulldown Options?

I need a Pulldown with a numeric range between 60 - 230 and it would be cumbersome to add Pulldown Options one by one by hand.

I've tried to make a numeric range pulldown as an UDT and create a "Module Interface Field" in FormBuilder and it works fine. But it should somehow tie in with the Formbuilder form and be recognised, so the selected valued get submitted.

So how do i get the FormID inserted in my Pulldown name in UDT?
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: FormBuilder Using a Pulldown from UDT

Post by webform »

I think i've figured it out;

I'm creating an User Defined Tag named height_dropdown :

Code: Select all

$form_id = isset($params['form_id']) ? $params['form_id'] : '';
$string = '<select class="form-control" name="' . $form_id . '" id="height_dropdown">' . PHP_EOL;
$string .= '<option selected="" value="">Choose one</option' . PHP_EOL;
for ($i = 60; $i <= 230; $i++) :
$string .= '<option value="';
$string .= $i;
$string .=  '">' . $i . ' cm</option>' . PHP_EOL;
endfor;

$string .= '</select>';

echo $string;
And then create a Module Interface Field in FormBuilder and insert my UDT "{height_dropdown form_id = $FBid}".

Only problem seems to be that field label, CSS Class and ID for the field is ignored.
Post Reply

Return to “Modules/Add-Ons”