Forums

How to transform a double dynamic dropdown to dynamic text?

FloB 07 Jan, 2016
Hello,

I have a double dynamic drop down created with this FAQ that works very well :
In the first dropdown, the user choose a journey he has created with an other form, and the second dropdown is populated (with set dynamic options and ajax) with the people who signed for the selected journey.

But what I need is not a dropdown but a table or a list (so some text) of the people who signed for the journey. I just want to show the information, I don't need the user to selection something.

It seems to need some javascript (from what I have understood when reading few posts) but someone can help me please?

Thanks
Florence
GreyHead 08 Jan, 2016
Hi Florence,

Unfortunately the double-drop-down code is only set up to do that. You can use the same form event but you need Custom JavaScript to make the Ajax call and then format and display the results.

What is the id of the first drop-down, and what do you want the results to look like?

Bob
FloB 08 Jan, 2016
Hi Bob,

The id of the first dropdown is ddSorties
I have a sql requete which find registrations for the journey selected in the first dropdown.
Each registration have an id, a state, a name, a first name, an email and a phone number and I would like to display a table :
<table>
<tbody>
<tr><th>Prénom</th>
<th>Nom</th>
<th>Inscrits</th>
<th>Téléphone</th></tr>
<tr><td>registration1_name</td>
<td>registration1_firstname</td>
<td>registration1_state</td>
<td>registration1_phone</td></tr>
<tr><td>registration2_name</td>
<td>registration2_firstname</td>
<td>registration2_state</td>
<td>registration2_email</td></tr>
</tbody>
</table>


No problem with php, for exemple if I have the drop down on a first page and the table on a second, but I'm stuck with JS.

Florence
This topic is locked and no more replies can be posted.