Hello-
I want to populate a dropdown from an external menu, but i want to run a WHERE on the query that populates the drop down.
i have the dropdown working- it displays ALL the entries for the field but I only want to display some of the field records.
For instance, let's say the field is a list of people's last names (l_name), and I only want to populate the dropdown with names="smith".. how do I do that? where do i put the code?
user_id, l_name
0,smith
1,jones
2,jackson
3,smith
In this example, I want to load just the names "smith" into my dropdown.
Thanks in advance!
I want to populate a dropdown from an external menu, but i want to run a WHERE on the query that populates the drop down.
i have the dropdown working- it displays ALL the entries for the field but I only want to display some of the field records.
For instance, let's say the field is a list of people's last names (l_name), and I only want to populate the dropdown with names="smith".. how do I do that? where do i put the code?
user_id, l_name
0,smith
1,jones
2,jackson
3,smith
In this example, I want to load just the names "smith" into my dropdown.
Thanks in advance!
Hi CyborgPrime,
You'd add an entry in the Conditions box of the DB Read action to limit the selection. There isn't enough info here to say exactly what that would look like though.
Bob
You'd add an entry in the Conditions box of the DB Read action to limit the selection. There isn't enough info here to say exactly what that would look like though.
Bob
I want to just load it with l_name where l_name="smith".
Maybe this is a better example: I want to load l-name into the drop down where membership_renewal>=today.
I get that it goes in the conditions box, but not sure the syntax db read is expecting.
Thanks!
Maybe this is a better example: I want to load l-name into the drop down where membership_renewal>=today.
I get that it goes in the conditions box, but not sure the syntax db read is expecting.
Thanks!
To make that clearer:
user_id, l_name, renewal_date
0, smith, 12-25-16
1, jones, 07-05-15
3, jackson, 12-15-16
I want the dropdown to load the names if the coresponding renewal date has not yet occurred, so the resulting drop down would only contain smith and jackson.
Thanks!
user_id, l_name, renewal_date
0, smith, 12-25-16
1, jones, 07-05-15
3, jackson, 12-15-16
I want the dropdown to load the names if the coresponding renewal date has not yet occurred, so the resulting drop down would only contain smith and jackson.
Thanks!
Hi CyborgPrime,
Please see this FAQ
The condition will be something like
Bob
Please see this FAQ
The condition will be something like
<?php
return array(':model_id.renewal_date >= NOW() ');
?>
Bob
I saw that FAQ before I posted here, but I didn't get what it was trying to say. You helped clarify that with your answer- thank you!
I didn't get what the examples were trying to show,but I WAS in the right area I guess, I was trying to figure out how to alter Complex Query for my purposes. But I get it now, thanks for your help!
I didn't get what the examples were trying to show,but I WAS in the right area I guess, I was trying to figure out how to alter Complex Query for my purposes. But I get it now, thanks for your help!
Thank you!
I had a model on a db read called "upcoming_events" and I only wanted the dropdown to load with events that haven't happened yet.
So with your help, this is what I ended up with:
This worked! What a great program Chronoforms is.. Thanks again!
I had a model on a db read called "upcoming_events" and I only wanted the dropdown to load with events that haven't happened yet.
So with your help, this is what I ended up with:
<?php
return array(':upcoming_events.event_start >= NOW() ');
?>
This worked! What a great program Chronoforms is.. Thanks again!
This topic is locked and no more replies can be posted.