Hi,
I have created multiple events with LISE. User can register to a event using a form (formbuilder). The form is mostly the same for all events, but the title (event title) and the dates (one event can have multiple dates) are different in every event.
So basically could I have just one form where:
- the value of title (text field) would be automatically fetched from the event data of the LISE event
- the values of the dates (Dropdown) would be automatically fetched from the event data of the LISE event.
Is it possible and if so, how?
Get the values of the form fields from another module
Re: Get the values of the form fields from another module
It's possible of course... keep in mind that this is basically a normal default LISE call, for instance on the top of form template do something like:urheat wrote:Is it possible and if so, how?
Code: Select all
{LISEMyTestModule assign=foo}
<pre>{$items|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!
Re: Get the values of the form fields from another module
Thanks Jo,
sorry for a newbie question but how can I print for example the title in a form. Tried too many ways
I mean something like this:
{LISEomamatkatuotanto assign=foo}
{$items->item->title}
<pre>{$items|print_r:1}</pre>
and in FormBuilder, how can I get the value? Is it the same syntax? For example if I have a Text Input, do I place the code to the "Smarty data or logic that is meant to be sent with this field":
{$items->item->title}
p.s. The LISE is just great!
sorry for a newbie question but how can I print for example the title in a form. Tried too many ways
{LISEomamatkatuotanto assign=foo}
{$items->item->title}
<pre>{$items|print_r:1}</pre>
and in FormBuilder, how can I get the value? Is it the same syntax? For example if I have a Text Input, do I place the code to the "Smarty data or logic that is meant to be sent with this field":
{$items->item->title}
p.s. The LISE is just great!
Re: Get the values of the form fields from another module
That won't work exactly like that: you need to single out an item first and for that you need to know either the id or the alias (actually there are ways to return one record from a number of parameters but that is another advanced topic).urheat wrote:{LISEomamatkatuotanto assign=foo}
{$items->item->title}
<pre>{$items|print_r:1}</pre>
So, once you have an id or alias (and how you get it is up to you, depends on what you are trying to implement) then there are a few ways you can make that work:
Code: Select all
{LISEomamatkatuotanto action=detail item=$item_alias assign=foo}
Or not so efficient but still valid
Code: Select all
{LISEomamatkatuotanto include_items=$item_id_or_alias assign=foo}"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: Get the values of the form fields from another module
Thanks Jo,
just to make sure I've have appropriate way passing the alias. The detail page of the Lise object is the same page where the form is. I created global alias variable in Lise Detail template:
And in the FormBuilder Form Template:
Is this ok? It works 
And what is the most easiest/practical way to set the value of the specific form field. For example if I have text input form field and I would like to set the title of the Lise object to it's value...? Now I set it with jQuery, but I hope there is a way to do it without using scripts:
All the above works. The real problem is that I don't have an idea how to create 1-* radio buttons depending how many items Lise object has. Every event has 1,2 or maybe 4 different dates. User should select one of the dates. So in the Form Builder form there should be the same amount radio buttons with the values of the Lise objects dates...
just to make sure I've have appropriate way passing the alias. The detail page of the Lise object is the same page where the form is. I created global alias variable in Lise Detail template:
Code: Select all
{$items = $items scope=parent}
{assign var='lisealias' value=$item->alias scope=global}Code: Select all
{LISEomamatkatuotanto action=detail item=$lisealias assign=foo}
{$item->title}And what is the most easiest/practical way to set the value of the specific form field. For example if I have text input form field and I would like to set the title of the Lise object to it's value...? Now I set it with jQuery, but I hope there is a way to do it without using scripts:
Code: Select all
<__script__>
$(document).ready(function(){
$("#title").val("{$item->title}");
});
</__script>

