margarizaldi
New Member
Hi everybody, I'm new in fabrik and know very limited (or insufficient, perhaps) knowledge in coding. Now I need your help to solve my problem in creating a small tournament registration form.
I have created a form/list called `Players` which a registered user (say, manager) can submit their players along with some details including gender, birthday, grade, etc.
Now I need those submitted players can be registered by each manager in a table called `match_registration`. The form/list contains:
My problem is in the last element (dbjoin), actually I could configure them using standard SQL Where statement e.g.:
But I need more "dynamic" filtering (perhaps using JS in dropdown elements) so that when the `category` value changed (e.g.: from 'Junior' to 'Senior'), the Where statement changes accordingly, e.g:
I'm thinking that this case can be done using JavaScript in 'category' element using onChange etc. but I don't know how to write the code at all
I've searched through this forum but I haven't found the answer, or maybe it's too simple so that no one discussed for it.
I accept any better idea so that it is possible or even easier to implement.
Regards.
I have created a form/list called `Players` which a registered user (say, manager) can submit their players along with some details including gender, birthday, grade, etc.
Now I need those submitted players can be registered by each manager in a table called `match_registration`. The form/list contains:
- dropdown element: match_registration___category
- dropdown element: match_registration___class
- dbjoin element: match_registration___player_name
My problem is in the last element (dbjoin), actually I could configure them using standard SQL Where statement e.g.:
Code:
where {thistable}.user_id = '{$my->id}'
and {thistable}.gender = 'male'
and {thistable}.grade >= '3'
and {thistable}.grade <= '7'
and {thistable}.birthday >= '2000-11-30'
and {thistable}.birthday <= '2004-12-01'
But I need more "dynamic" filtering (perhaps using JS in dropdown elements) so that when the `category` value changed (e.g.: from 'Junior' to 'Senior'), the Where statement changes accordingly, e.g:
Code:
...
and {thistable}.grade >= '8'
and {thistable}.grade <= '10'
and {thistable}.birthday >= '1977-11-30'
and {thistable}.birthday <= '2000-12-01'
...
I'm thinking that this case can be done using JavaScript in 'category' element using onChange etc. but I don't know how to write the code at all
I've searched through this forum but I haven't found the answer, or maybe it's too simple so that no one discussed for it.
I accept any better idea so that it is possible or even easier to implement.
Regards.