Hi everybody, i'm trying to have working the following form:
Preview
.....some text box before ....
1)first dropdown: Field Name: user_sport_id | Field ID: sportsDrop | Show Empty : Selezionare Sport
2)second dropdown: Field Name: user_ruolo_id | Field ID: rolesDrop | Show Empty : Selezionare Ruolo
3)third dropdown: Field Name: user_categoria_id | Field ID: categoriesDrop | Show Empty : Selezionare Cateogia
.....
Events
On on_load event i have 3 DB multi record loader event for the 3 dropdowns above and 2 dynamic dropdown event:
1) Source ID: sportsDrop | Target ID: rolesDrop | AJAX event : sportsDrop_changed
2) Source ID: rolesDrop | Target ID: categoriesDrop | AJAX event : rolesDrop_changed
On the AJAX events I have(the code is almost the same for both events):
sportsDrop_changed)
1)DB FIeld: sport_id(foreign key field of the table of the second drop down) | Request Param: user_sport_id
2)Custom code:
rolesDrop_changed)
1)DB FIeld: ruolo_id(foreign key field of the table of the third drop down) | Request Param: user_ruolo_id
2)Custom code: ----
Now: when i select on the first or second dropdown the "Show Empty" value i've on the connected dropdown this:
--------------------------------------------------------------
"http://www.w3.org/1999/xhtml" xml:lang=
"viewport" content
"content-type" content
"generator" content...
.........
---------------------------------------------------------------
Using the firefox debugger I noticed that the "call index.php?option=com_chronoforms&chronoform=gestione_anagrafica_ita-2&event=sportsDrop_changed" have success and the responsetxt is the content of the *php file.
I have another form with 3 dropdown and when i select the Show Empty value the following dropdowns simply remain empty...
I really don't understand where i'm wrong on this form.
Does anybody can help me?
Thank you very much.
Preview
.....some text box before ....
1)first dropdown: Field Name: user_sport_id | Field ID: sportsDrop | Show Empty : Selezionare Sport
2)second dropdown: Field Name: user_ruolo_id | Field ID: rolesDrop | Show Empty : Selezionare Ruolo
3)third dropdown: Field Name: user_categoria_id | Field ID: categoriesDrop | Show Empty : Selezionare Cateogia
.....
Events
On on_load event i have 3 DB multi record loader event for the 3 dropdowns above and 2 dynamic dropdown event:
1) Source ID: sportsDrop | Target ID: rolesDrop | AJAX event : sportsDrop_changed
2) Source ID: rolesDrop | Target ID: categoriesDrop | AJAX event : rolesDrop_changed
On the AJAX events I have(the code is almost the same for both events):
sportsDrop_changed)
1)DB FIeld: sport_id(foreign key field of the table of the second drop down) | Request Param: user_sport_id
2)Custom code:
<?php
$results = array();
// the next line set the first 'nothing selected' option.
$results[] = '-1=Selezionare Ruolo';
foreach ( $form->data['RolesDataModel'] as $v ) {
$results[] = $v['id'].'='.$v['ruolo_nome'];
}
$results = implode("\n", $results);
//Ritorno dei valori
echo $results;
//Stop esecuzione
$mainframe =JFactory::getApplication();
$mainframe->close();
?>
rolesDrop_changed)
1)DB FIeld: ruolo_id(foreign key field of the table of the third drop down) | Request Param: user_ruolo_id
2)Custom code: ----
Now: when i select on the first or second dropdown the "Show Empty" value i've on the connected dropdown this:
--------------------------------------------------------------
"http://www.w3.org/1999/xhtml" xml:lang=
"viewport" content
"content-type" content
"generator" content...
.........
---------------------------------------------------------------
Using the firefox debugger I noticed that the "call index.php?option=com_chronoforms&chronoform=gestione_anagrafica_ita-2&event=sportsDrop_changed" have success and the responsetxt is the content of the *php file.
I have another form with 3 dropdown and when i select the Show Empty value the following dropdowns simply remain empty...
I really don't understand where i'm wrong on this form.
Does anybody can help me?
Thank you very much.
Hi Tozai_X,
It's not easy to work out from here, Please post a link to the form so I can take a quick look.
It may be that the URL to call the Ajax event needs to include &format=raw to prevent the template being included.
Bob
It's not easy to work out from here, Please post a link to the form so I can take a quick look.
It may be that the URL to call the Ajax event needs to include &format=raw to prevent the template being included.
Bob
Tnx Bob for your reply.
Yes, you're right: it's not easy π
You can check here: http://www.refermind.com/svil1/
Then Login: "piero@email.it" / "piero1"
and click on "Personalizza Allenamento" in TopMenu to see the form.
The triple Dynamic Dropdowns are at he end of form.
Thank in advance for your help.
PS: where i can include "&format=raw" ? In "AJAX Event Name" Field?
MT
Yes, you're right: it's not easy π
You can check here: http://www.refermind.com/svil1/
Then Login: "piero@email.it" / "piero1"
and click on "Personalizza Allenamento" in TopMenu to see the form.
The triple Dynamic Dropdowns are at he end of form.
Thank in advance for your help.
PS: where i can include "&format=raw" ? In "AJAX Event Name" Field?
MT
Hi MT,
The drop-downs there appear to be working correctly. Where are the ones that don't'work?
Bob
The drop-downs there appear to be working correctly. Where are the ones that don't'work?
Bob
Really?!?
If I select "Seleziona Sport" on the first dropdown...
Check the attachment.
[attachment=0]Triple.png[/attachment]
If I select "Seleziona Sport" on the first dropdown...
Check the attachment.
[attachment=0]Triple.png[/attachment]
Hi Tozai_X,
Sorry, I didn't look in the right place :-(
What you are getting back then is an empty web page with just the template (see image). I'm not clear if that is because the link isn't going to the form or if there is an error in your PHP. Adding the -1 entry to the results does look odd.
I wonder, does the DB Read in the Ajax event have an Event Loop or Redirect on Fail? That would return a web page.
Bob
Sorry, I didn't look in the right place :-(
What you are getting back then is an empty web page with just the template (see image). I'm not clear if that is because the link isn't going to the form or if there is an error in your PHP. Adding the -1 entry to the results does look odd.
I wonder, does the DB Read in the Ajax event have an Event Loop or Redirect on Fail? That would return a web page.
Bob
Thank you Bob.
Yes you're right, i'm getting back empty page...
But why this form:
http://www.refermind.com/svil1/index.php?option=com_chronoforms&chronoform=start_training_1_ita
appears to be working correctly?
The PHP is the same, the results are different.
May I attach the form backup file? Can be useful?
Yes you're right, i'm getting back empty page...
But why this form:
http://www.refermind.com/svil1/index.php?option=com_chronoforms&chronoform=start_training_1_ita
appears to be working correctly?
The PHP is the same, the results are different.
May I attach the form backup file? Can be useful?
Hi Tozai_X,
The backup isnβt very useful with Ajax problems as I don't have the database tables necessary to get the code to work. By all means email or PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.
Bob
The backup isnβt very useful with Ajax problems as I don't have the database tables necessary to get the code to work. By all means email or PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.
Bob
Hi Tozai_X,
I fixed the problem in the first pair of drop-downs in the gestione_anagrafica_ita form.
You had an Event Loop action in the 'No Record Found' box of the DB Record Loader. What happened was that when no record was found the action tried to return the form that event was linked to and showed you a site page.
I replaced the Event Loop with a Custom Code action that returns a single option:
Bob
I fixed the problem in the first pair of drop-downs in the gestione_anagrafica_ita form.
You had an Event Loop action in the 'No Record Found' box of the DB Record Loader. What happened was that when no record was found the action tried to return the form that event was linked to and showed you a site page.
I replaced the Event Loop with a Custom Code action that returns a single option:
echo '=Selezionare Sport';
Bob
hello,
it would be possible to have the complete file?
I am ready even to give an economic contribution
thanks so much
Antonio
it would be possible to have the complete file?
I am ready even to give an economic contribution
thanks so much
Antonio
Hi Antonio,
If you have v5 then there is a dynamic dropdown demo form included!
Regards,
Max
If you have v5 then there is a dynamic dropdown demo form included!
Regards,
Max
Hi Max,
i used the v5, bat the demo not have 3 dinamic dropdown
Regards
Antonio
i used the v5, bat the demo not have 3 dinamic dropdown
Regards
Antonio
Hi Antonio,
Sorry for the late answer.
Yes, but you can use the same idea.
Regards,
Max
Sorry for the late answer.
Yes, but you can use the same idea.
Regards,
Max
This topic is locked and no more replies can be posted.