Hello,
I have the following requirement, but unfortunatly I have no idea how to solve it... Perhaps someone can give me some hints:
(A) I have a (customer) database table "sports_event" with the following columns:
- id
- event_name
- option_1
- option_2
- option_3
(B) In the first step I want to populate a dropdown box with the events, so the user can choose one event.
(C) Depending on the selection of the sports event in the dropdown box a input field, radio buttons and another dropdown box shall appear / disappear.
Suppose the following data in the database table:
=> 1 / event 1 / Y / N / Y
=> 2 / event 2 / N / N / N
=> 3 / event 3 / N / Y / Y
=> 4 / event 4 / Y / Y / N
If the user selects event 1 then:
- entryfield10 is visible and enabled
- radiogroup11 consists of radio box 1 and radio box 3 (but not radio box2)
- dropdown12 is visible and enabled
If the user selects event 2 then:
- entryfield10 is not visible and is disabled
- radiogroup11 consists of radio box 1 and radio box 3 (but not radio box2)
- dropdown12 is not visible and is disabled
If the user selects event 3 then:
- entryfield10 is not visible and is disabled
- radiogroup11 consists of radio box 1 and radio box 2 and radio box 3
- dropdown12 is visible and enabled
If the user selects event 4 then:
- entryfield10 is visible and enabled
- radiogroup11 consists of radio box 1 and radio box 2 and radio box 3
- dropdown12 is not visible and disabled
I know how to read data from a database table. If I use "return an array of key/value pairs..." as Select type in the Read Data event, then only two fields (e.g. id and event_name) can be used (Fields to retrieve) for filling the dropdown box. But I want to select all fields (using "all matching records" as Select Type in the Read Data event) when loading the form in order to have all data already in memory.
Now my questions:
[list=]
How selecting all fields of the database table (using "all matching records" as Select Type in the Read Data event) and populating dropdown box only with two of them (id, event_name)?
How to handle the additional fields (option_1, option_2, option_3) in order that they can control the other fields (entryfield10, radiogroup11, dropdown12), depending on the selection in the dropdown box?
[/list]
Perhaps someone in the community can help me. I searched in the forum for similar solutions, but unfortunately I didn#t find some...
Thanks for giving me some hints
Hans-Christian
I have the following requirement, but unfortunatly I have no idea how to solve it... Perhaps someone can give me some hints:
(A) I have a (customer) database table "sports_event" with the following columns:
- id
- event_name
- option_1
- option_2
- option_3
(B) In the first step I want to populate a dropdown box with the events, so the user can choose one event.
(C) Depending on the selection of the sports event in the dropdown box a input field, radio buttons and another dropdown box shall appear / disappear.
Suppose the following data in the database table:
=> 1 / event 1 / Y / N / Y
=> 2 / event 2 / N / N / N
=> 3 / event 3 / N / Y / Y
=> 4 / event 4 / Y / Y / N
If the user selects event 1 then:
- entryfield10 is visible and enabled
- radiogroup11 consists of radio box 1 and radio box 3 (but not radio box2)
- dropdown12 is visible and enabled
If the user selects event 2 then:
- entryfield10 is not visible and is disabled
- radiogroup11 consists of radio box 1 and radio box 3 (but not radio box2)
- dropdown12 is not visible and is disabled
If the user selects event 3 then:
- entryfield10 is not visible and is disabled
- radiogroup11 consists of radio box 1 and radio box 2 and radio box 3
- dropdown12 is visible and enabled
If the user selects event 4 then:
- entryfield10 is visible and enabled
- radiogroup11 consists of radio box 1 and radio box 2 and radio box 3
- dropdown12 is not visible and disabled
I know how to read data from a database table. If I use "return an array of key/value pairs..." as Select type in the Read Data event, then only two fields (e.g. id and event_name) can be used (Fields to retrieve) for filling the dropdown box. But I want to select all fields (using "all matching records" as Select Type in the Read Data event) when loading the form in order to have all data already in memory.
Now my questions:
[list=]
[/list]
Perhaps someone in the community can help me. I searched in the forum for similar solutions, but unfortunately I didn#t find some...
Thanks for giving me some hints
Hans-Christian