First of all sorry if this request is in the wrong place.
I was wondering, is it possible to have a drop down box on a form that is populated (Value and text) from the titles of articles within a category?
I want to create a category for job postings, one article for one job with an apply here button. Once the button is clicked you are taken to the form and you can select the job from the said drop down. In an ideal world the apply now would be a form and a session varible that selects the job tile from the drop down for you but I don't want to complicate the process of job posting for the client.
Many Thanks
Anthony Clarke
I was wondering, is it possible to have a drop down box on a form that is populated (Value and text) from the titles of articles within a category?
I want to create a category for job postings, one article for one job with an apply here button. Once the button is clicked you are taken to the form and you can select the job from the said drop down. In an ideal world the apply now would be a form and a session varible that selects the job tile from the drop down for you but I don't want to complicate the process of job posting for the client.
Many Thanks
Anthony Clarke
Hi Anthony,
Create your form in the normal way and then amend the code for the drop down field in the form HTML to include a MySQL query pulling the relevant information from the database and populating the drop down field.
Here is a recent example where I have a "Countries" table in the database and this is a drop-down to select a country:
You will need to work out an appropriate query for your needs but hopefully this is enough to get you started.
Neil.
Create your form in the normal way and then amend the code for the drop down field in the form HTML to include a MySQL query pulling the relevant information from the database and populating the drop down field.
Here is a recent example where I have a "Countries" table in the database and this is a drop-down to select a country:
<div class="ccms_form_element cfdiv_select" id="country_container_div"><label for="Country">Country:</label><select size="1" id="Country" class="" title="Country" name="Country">
<option value="">Not Country Specific</option>
<?php
$database =& JFactory::getDBO();
$database->setQuery("SELECT Country FROM #__chronoforms_data_Countries ORDER BY Country");
$countries = $database->loadObjectList();
foreach($countries as $country):
?>
<option value="<?php echo $country->Country; ?>"><?php echo $country->Country; ?></option>
<?php endforeach; ?>
</select>
<div class="clear"></div><div id="error-message-Country"></div></div>You will need to work out an appropriate query for your needs but hopefully this is enough to get you started.
Neil.
Hi squawk,
As well as Neil's solution you can do this with the a DB Multi Record Loader action and the Dynamic Value tab in Drop Down element. Or you can buy a copy of my Custom Select [GH] action which has the built-in ability to create article lists.
Bob
As well as Neil's solution you can do this with the a DB Multi Record Loader action and the Dynamic Value tab in Drop Down element. Or you can buy a copy of my Custom Select [GH] action which has the built-in ability to create article lists.
Bob
Bob,
I need to do something like this (and I have purchased your Custom Select action).
I want to populate a drop-down box with data from another table. Specifically, I want the box to pull based on this query:
Is there a way to utilize your custom action to do this? I have tried multiple ways - all have failed. 😶
Thanks!!
Rick
I need to do something like this (and I have purchased your Custom Select action).
I want to populate a drop-down box with data from another table. Specifically, I want the box to pull based on this query:
SELECT `client_id`, `client_name` FROM `#__trip_client_customers`Is there a way to utilize your custom action to do this? I have tried multiple ways - all have failed. 😶
Thanks!!
Rick
Hi Rick,
Just packing up for the evening when I saw this. Please see this FAQ.
More in the morning if you still need it.
Bob
Just packing up for the evening when I saw this. Please see this FAQ.
More in the morning if you still need it.
Bob
This topic is locked and no more replies can be posted.
