FormBuilder dropdown with data from LISE
-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
Same issue I'm afraid, comes through on the email as 'unspecified'
Re: FormBuilder dropdown with data from LISE
Hmmm try to replace {$test_field->input_id} with {$test_field->name}.
I'm almost sure the first should also work, but... I may have it wrong, being in a hurry and all
I'm almost sure the first should also work, but... I may have it wrong, being in a hurry and all
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: FormBuilder dropdown with data from LISE
Nope! disregard the above post... {$test_field->input_id} or {$fld_36->input_id} have to work: I just tested.
PS: the HTML field name should be something like name="cntnt01fbrp__36"
PS: the HTML field name should be something like name="cntnt01fbrp__36"
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
Thanks for your patience Jo - I must be doing something wrong... lets go through what I've done again...
Here's how I have FB set up:

Here's the code in the 'advanced' tab of the send results field (I tried a few methods!):
And here's the form template:
Where am I going wrong?!
Here's how I have FB set up:

Here's the code in the 'advanced' tab of the send results field (I tried a few methods!):
Code: Select all
{if $test_field != "" && $test_field != "[unspecified]" }<strong>test_field</strong>: {$test_field}<br />{/if}
{$test_field}
{$fld_36}
{$fld_36_obj->name} = {$fld_36_obj->value}
{$m16e7dfbrp__36}Code: Select all
{* DEFAULT FORM LAYOUT / pure CSS *}
{literal}
<__script__ type="text/javascript">
function fbht(htid)
{
var fbhtc=document.getElementById(htid);
if (fbhtc)
{
if (fbhtc.style.display == 'none')
{
fbhtc.style.display = 'inline';
}
else
{
fbhtc.style.display = 'none';
}
}
}
</__script>
{/literal}
{$fb_form_header}
{if $fb_form_done == 1}
{* This first section is for displaying submission errors *}
{if isset($fb_submission_error) && $fb_submission_error}
<div class="error_message">{$fb_submission_error}</div>
{if isset($fb_show_submission_errors) && $fb_show_submission_errors}
<div class="error">
<ul>
{foreach from=$fb_submission_error_list item=thisErr}
<li>{$thisErr}</li>
{/foreach}
</ul>
</div>
{/if}
{/if}
{else}
{* this section is for displaying the form *}
{* we start with validation errors *}
{if isset($fb_form_has_validation_errors) && $fb_form_has_validation_errors}
<div class="error_message">
<ul>
{foreach from=$fb_form_validation_errors item=thisErr}
<li>{$thisErr}</li>
{/foreach}
</ul>
</div>
{/if}
{if isset($captcha_error) && $captcha_error}
<div class="error_message">{$captcha_error}</div>
{/if}
{*
{LISECourses assign = junk}
<select class="form-control required" title="Select Item" name="{$actionid}{$test_field->input_id}" id="{$actionid}{$test_field->input_id}">
<option value="z">Select items</option>
{foreach $items as $item}
<option value="{$item->alias}">{$item->title}</option>
{/foreach}
</select>
*}
{LISECourses assign = junk}
<select class="form-control required" title="Select Item" name="{$actionid}{$fld_36->input_id}" id="test_field">
<option value="">Select items</option>
{foreach $items as $item}
<option value="{$item->alias}">{$item->title}</option>
{/foreach}
</select>
{* and now the form itself *}
{$fb_form_start}
<div>{$fb_hidden}</div>
<div{if $css_class != ''} class="{$css_class}"{/if}>
{if $total_pages gt 1}<span>{$title_page_x_of_y}</span>{/if}
{if isset($has_captcha) && $has_captcha == 1}
<div class="captcha">{$graphic_captcha}{$title_captcha}<br />{$input_captcha}</div>
{/if}
<div class="submit">{$prev}{$submit}</div>
</div>
{$fb_form_end}
{/if}
{$fb_form_footer}Re: FormBuilder dropdown with data from LISE
Code: Select all
{LISECourses assign = junk}
<select class="form-control required" title="Select Item" name="{$actionid}{$fld_36->input_id}" id="test_field">
<option value="">Select items</option>
{foreach $items as $item}
<option value="{$item->alias}">{$item->title}</option>
{/foreach}
</select>And {$fb_hidden} should be right after form start.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
ok - have moved it (code below) still not working. FYI when output to hTMl this is what the select form code is:
Code: Select all
<select class="form-control required" title="Select Item" name="m16e7d" id="test_field">
<option value="">Select items</option>
<option value="a_test">A test</option>
<option value="another-test">Another test</option>
</select>Code: Select all
{* DEFAULT FORM LAYOUT / pure CSS *}
{literal}
<__script__ type="text/javascript">
function fbht(htid)
{
var fbhtc=document.getElementById(htid);
if (fbhtc)
{
if (fbhtc.style.display == 'none')
{
fbhtc.style.display = 'inline';
}
else
{
fbhtc.style.display = 'none';
}
}
}
</__script>
{/literal}
{$fb_form_header}
{if $fb_form_done == 1}
{* This first section is for displaying submission errors *}
{if isset($fb_submission_error) && $fb_submission_error}
<div class="error_message">{$fb_submission_error}</div>
{if isset($fb_show_submission_errors) && $fb_show_submission_errors}
<div class="error">
<ul>
{foreach from=$fb_submission_error_list item=thisErr}
<li>{$thisErr}</li>
{/foreach}
</ul>
</div>
{/if}
{/if}
{else}
{* this section is for displaying the form *}
{* we start with validation errors *}
{if isset($fb_form_has_validation_errors) && $fb_form_has_validation_errors}
<div class="error_message">
<ul>
{foreach from=$fb_form_validation_errors item=thisErr}
<li>{$thisErr}</li>
{/foreach}
</ul>
</div>
{/if}
{if isset($captcha_error) && $captcha_error}
<div class="error_message">{$captcha_error}</div>
{/if}
{* and now the form itself *}
{$fb_form_start}
<div>{$fb_hidden}</div>
{LISECourses assign = junk}
<select class="form-control required" title="Select Item" name="{$actionid}{$fld_36->input_id}" id="test_field">
<option value="">Select items</option>
{foreach $items as $item}
<option value="{$item->alias}">{$item->title}</option>
{/foreach}
</select>
<div{if $css_class != ''} class="{$css_class}"{/if}>
{if $total_pages gt 1}<span>{$title_page_x_of_y}</span>{/if}
{if isset($has_captcha) && $has_captcha == 1}
<div class="captcha">{$graphic_captcha}{$title_captcha}<br />{$input_captcha}</div>
{/if}
<div class="submit">{$prev}{$submit}</div>
</div>
{$fb_form_end}
{/if}
{$fb_form_footer}Re: FormBuilder dropdown with data from LISE
name="m16e7d" means the {$actionid} is working but {$fld_36} is probably wrong.Code: Select all
<select class="form-control required" title="Select Item" name="m16e7d" id="test_field">
Again {$actionid}{$test_field->input_id} should work.
To see the ouput of the field use this:
Code: Select all
<pre>{$test_field|print_r:1}</pre>Code: Select all
<pre>{$fields|print_r:1}</pre>"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
ok, these are the fields.. which are the 2 fields in FB - the text input and the email send.
What I dont understand (so having trouble working out how to solve!) is how the custom select box is supposed to transfer its data into the empty text input (field 36) ... this is obviously the part of the process thats going wrong
What I dont understand (so having trouble working out how to solve!) is how the custom select box is supposed to transfer its data into the empty text input (field 36) ... this is obviously the part of the process thats going wrong
Code: Select all
Array
(
[fbrp__36] => stdClass Object
(
[id] => 36
[display] => 1
[required] => 0
[required_symbol] =>
[css_class] =>
[helptext] =>
[field_helptext_id] => fbrp_ht_36
[valid] => 1
[error] =>
[hide_name] => 0
[has_label] => 1
[needs_div] => 1
[name] => test_field
[input] =>
[logic] =>
[values] =>
[value] =>
[smarty_eval] => 0
[multiple_parts] => 0
[label_parts] => 1
[type] => Text Input
[input_css_id] => test_field
[input_id] => fbrp__36
[alias] => test_field
)
[fbrp__35] => stdClass Object
(
[id] => 35
[display] => 0
[required] => 0
[required_symbol] =>
[css_class] =>
[helptext] =>
[field_helptext_id] => fbrp_ht_35
[valid] => 1
[error] =>
[hide_name] => 0
[has_label] => 1
[needs_div] => 1
[name] => Send results
[input] =>
[logic] =>
[values] =>
[value] =>
[smarty_eval] => 0
[multiple_parts] => 0
[label_parts] => 1
[type] => *Email Results to set Address(es)
[input_css_id] => fbrp__35
[input_id] => fbrp__35
[alias] => send_results
)
)Re: FormBuilder dropdown with data from LISE
As you can see input_id is filled so {$test_field->input_id} HAS to output something...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
But is it filled with 'nothing' as we've created a blank Text Input field?
Plus, those values are the state as the page has loaded - before anything is done with the dropdown selector
Plus, those values are the state as the page has loaded - before anything is done with the dropdown selector
Re: FormBuilder dropdown with data from LISE
It doesn't really matter unless we need file inputs which FB handles differently. For FB what matters is the field name as that is what tells FB what field is being filled with what value(s). If you defined the input as dropdown in FB there was no easy way to make the options be generated dynamically. This way FB doesn't care how the field value is generated. As you can have custom validation you can even check if the options fall inside the available range of options in case that is critical.johnboyuk1 wrote:But is it filled with 'nothing' as we've created a blank Text Input field?
Plus, those values are the state as the page has loaded - before anything is done with the dropdown selector
So if the field name is correct (which wasn't as we could see from the generated name='"" field parameter) FB sees it. The form HTML has to be valid too, but other than that, it has to work. I do it all the time. You could even have checkboxes, multiselectors, and javascript auto generated fields and FB would see those as textinputs if the HTML is correct.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
Thanks for continuing to help me out! Because I'm not entirely sure how this is/supposed to work I'm having trouble following and working out where I'm going wrong?
You can see the last template in the post further above, and also a screen grab showing the fields set up through FB... have I done this part correctly - does anything special need to go in the advance tab for this text input field?
Have just added an extra text input field to the form to make sure that comes through the email ok - and it does
So the issue is with the dropdown not 'replacing' the value in the Text Input ... and therefore showing as unspecified ... so where am I going wring with this, is FB supposed to replace this value just because we've given them the same names?
You can see the last template in the post further above, and also a screen grab showing the fields set up through FB... have I done this part correctly - does anything special need to go in the advance tab for this text input field?
Have just added an extra text input field to the form to make sure that comes through the email ok - and it does
So the issue is with the dropdown not 'replacing' the value in the Text Input ... and therefore showing as unspecified ... so where am I going wring with this, is FB supposed to replace this value just because we've given them the same names?
Re: FormBuilder dropdown with data from LISE
Well yes!johnboyuk1 wrote: ... so where am I going wring with this, is FB supposed to replace this value just because we've given them the same names?
I'm not sure what was that you have done wrong, but the HTML rendered is not correct:
Code: Select all
<select class="form-control required" title="Select Item" name="m16e7d" id="test_field">{$actionid}{$test_field->input_id} should be rendered i.e. name="m16e7dfbrp__36".
As I can't reproduce the error I'm assuming it's something with your template, a typo or something, but i can't debug it...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
The form html is rendering correctly - we must have done something since that post, here's how the form renders to html now:
But I still get 'unspecified' in the email .. 
Code: Select all
<select class="form-control required" title="Select Item" name="m16e7dfbrp__36" id="m16e7dfbrp__36">
<option value="" selected="selected">Select items</option>
<option value="a_test">A test</option>
<option value="another-test">Another test</option>
<option value="the_thinking_partnership">The Thinking Partnership</option>
</select>-
johnboyuk1
- Forum Members

- Posts: 235
- Joined: Mon Nov 26, 2018 3:09 pm
Re: FormBuilder dropdown with data from LISE
If anyone has any ideas on making this work it'd be greatly appreciated! I'm pulling my hair out ... 

