This topic is locked
[SOLVED]

 Conditional Dropdown using Values field change

10/20/2014 6:47:51 AM
PHPRunner General questions
A
Anapolis author

I know how to use the Conditional Dropdown behavior to make the select list of Dropdown B dependent on the Value chosen in Dropdown A.
But this cannot be used for my situation. However, I am hoping someone in the PHPRunner community has already solved this kind of dropdown.
I have a master table of pharmacies. There may be 120 pharmacies all containing the same value in one field which indicates that one particular person services all of those pharmacies.
So let's say there are 30 different service personnel. In the pharmacies table there is a field that holds their full name, and another field that holds their key id number.
When "Sarah Brown" logs in she is given a filtered list of pharmacies, only permitted to see those pharmacy records which have her name and key id #.
The solution I am looking for--
In a Reporting form I have a field where one of the Service employees is selected from a dropdown list of 30 people.
What I then need is to provide a dropdown list B which dynamically changes according to the Service employee who is selected above this field.

In the dropdown list B of one pharmacy to choose from I want to provide only the selection list of all pharmacies belonging the selected Service employee in Dropdown list A.
So, unlike the Dropdown Dependency of PHPRunner, this dropdown must be assembled by a filtering action that does not load (so there are no errors) until a value is entered into Field A.
the WHERE statement would be " WHERE service_name = '" . $value['fieldA_value'] . "'";
I have used a Javascript snippet to search a table for the value entered into a form before the form has been submitted and notify if a record already exists.


Is there a way to use the "live" SET value of Field A to immediately compose a dropdown list using that same value in Field A that can be accessed in Field B?

Thank you for taking the time to read!

M
mfriend 10/20/2014

Hi Maverick:
I hope someone knows the answer to your question. If you can get your idea to work it would really help me.

I posted a question a couple of weeks ago that is similar but so far no one has responded

(My previous post on a dynamic where statement using a fields value./ )
Matthew

admin 10/21/2014

@Maverick,
I'm struggling to understand how is that what you describing is different from dependent dropdown boxes. They work exactly the way you describe and second dropdown box is not populated until selection is made in the first dropdown box.
@mfriend
I do understand that what you looking for is more complicated than simple dependent dropdown boxes. I'll see if we can come up with tutorial.

M
mfriend 10/21/2014



@Maverick,
I'm struggling to understand how is that what you describing is different from dependent dropdown boxes. They work exactly the way you describe and second dropdown box is not populated until selection is made in the first dropdown box.
@mfriend
I do understand that what you looking for is more complicated than simple dependent dropdown boxes. I'll see if we can come up with tutorial.



If you could come up with a tutorial that would be awesome!!
Thanks,
Matthew

admin 10/22/2014

Tutorial can be found at http://www.asprunner.com/forums/topic/22701-custom-dependent-dropdown-boxes/ and I'm adding more examples there

A
Anapolis author 11/5/2014



Tutorial can be found at http://www.asprunner.com/forums/topic/22701-custom-dependent-dropdown-boxes/ and I'm adding more examples there



"

THANKS SERGEY! This is what I am talking about where "the business-as-usual" dropdown needs some coding help outside of the wizard-only. In reading your new Tutorial I realized that you did understand the special circumstances I brought up in trying to set up an enhanced drop-down feature.