Forums

Return value dropdown

salvok5 09 Feb, 2017
my problem is to return to a button_link a value taken from the selection in a dropdown.

Button_link:
{url:view_elenco}&gr={fn:ricerca_gruppo}

Views->Fields->Dropdown:
Name: select5[]
ID: select5

Functions : ricerca_gruppo
code : echo $this->select5->value;

by selecting a value on the dropdown list and clicking button_link returns nothing on gr=.
where is the error ?
Max_admin 10 Feb, 2017
Hi Salvo,

The dropdown is on the same page ? or a form is sent after the dropdown is selected ?

If a form is sent then you can get any field value using: {data:field_name}

If its on the same page then this will need some code, let me know if this is the case.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
salvok5 10 Feb, 2017
as previously explained to, are on view -> Index, with dropdown they select.
Clicking Button_link mi have to open another view
and it must return the link the value of dropdown choice.
This does not work:
{url:view_elenco}&gr={data:select5}
Max_admin 11 Feb, 2017
Hi salvo,

Please try to include this code inside a "JS" view and include it in the same page:

$( document ).ready(function() {
$("#dropdown_id").on("change", function(){
$("#button_link_id").attr("href", $("#button_link_id").attr("href") + "&gr=" + $("#dropdown_id").val());
});
});


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 13 Feb, 2017
Hi salvo,

Did you replace the elements ids with the real ids of your fields in the code ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
salvok5 13 Feb, 2017
I have made a view JS: richiama_drop

on Content I insert this:
$( document ).ready(function() {
$("#dropdown_id").on("change", function(){
$("#button_link_id").attr("href", $("#button_link_id").attr("href") + "&gr=" + $("#dropdown_id").val());
});
});


or this?
$( document ).ready(function() {
$("#select5").on("change", function(){
$("#Ricerca").attr("href", $("#Ricerca").attr("href") + "&gr=" + $("#select5").val());
});
});


of index event i have included this:
{fn:richiama_valori_tipo}
{fn:richiama_valori_settore}
{view:richiama_drop}
{view:Campi-ricerca}
{debug:}

and Button_link have insert this:
{url:view_elenco}{view:richiama_drop}

But it does not work.

If, please, can you tell me step by step how and where they enter codes.
If I can give you some advice is to write a tutorial DETAILED with ALL the functions that can be use and with MANY examples, only way to use profitably this library.
Thank you
salvok5 13 Feb, 2017

Hi salvo,

Did you replace the elements ids with the real ids of your fields in the code ?

Best regards,
Max


yes.
Max_admin 13 Feb, 2017
Hi salvo,

Its the 2nd code which you should use, do you have a link to this page online so I can test this ?

I will try to write more tutorials, but the issue here is custom code, so it can not be included in tutorials.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 13 Feb, 2017
Answer
ok, please change the first line of the code to this:
jQuery(document).ready(function($){


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
salvok5 13 Feb, 2017
1 Likes
It's WORK.
You are a great MAX😀😀😀
salvok5 13 Feb, 2017
I'm sorry but there is an error on the code:
If I click on the first choice -> "AVVISO"
then instead change the selection with -> "BANDO" the link is well with 2 &gr=
http://www.comunesortino.gov.it/index.php/component/chronoconnectivity6/?cont=manager&conn=albo-ricerca&event=view_elenco&gr=0&gr=2
salvok5 13 Feb, 2017
solution found.
Max_admin 14 Feb, 2017
Hi Salvo,

Even if the link has 2 values for the same parameter, only the 2nd one will work.🙂

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.