TOPIC:

Form Options / more options 4 months 4 weeks ago #241164

  • Topic Author
  • atomicjp
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
hi, i'm new to breezingforms but i'm loving...

i need to make a form to populate a couple of select list boxes with some criteria within a tables in a database.

it seems that i need to go to Form options >>> more options and a pop-up will appear , but with my configuration just appear a page without the settings that i need to modify.

can you help me?

thanks in advance,
Joao

Please Log in or Create an account to join the conversation.

Form Options / more options 4 months 4 weeks ago #241181

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 803
Hi,

the easiest way would be to populate the select lists right in the select list definition. For example:
<?php
$db = JFactory::getDbo();
$db->setQuery("Your Query here");
$items = $db->loadObjectList();
$item_count = count($items);
$list = '';

for($i = 0; $i < $item_count; $i++){
    
     $list .= '0;' . $items[$i]->a . ';' . $items[$i]->b ."\n";
}

return $list;
?>

Where the a and b from "$items[$i]->a" and "$items[$i]->b" are the column names from your db query.

The other method is valid as well, but is thought for cross-dependencies between lists and things like that.

My example above is basically the quick and easy method.

Regards,
Markus
The following user(s) said Thank You: atomicjp

Please Log in or Create an account to join the conversation.

Form Options / more options 4 months 4 weeks ago #241205

  • Topic Author
  • atomicjp
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
thanks very much, it's working, but now want to populate another select list using the data that i select before in the sql where condition.

thanks again
Joao

Please Log in or Create an account to join the conversation.

Form Options / more options 4 months 4 weeks ago #241236

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 803
Hi,

this gets a bit more complicated. Therefore I created a so called "make / model" selection form that you can use as boilerplate and adjust to your needs.

It basically includes what I mentioned before but with the addition that the other select list updates based on the selection of the first option (therefore "make / model").

Please download the zip attached and unzip.
Then import the sql file using phpMyAdmin and rename the db prefix of the 2 #__bf_makes and #__bf_models tables, matching your joomla db prefix (so they can be addressed in queries).

Then import the xml file (=the actual form) in BF => Configuration => Package Installer.

After installation, the form is available in the form manager and ready to run.

There are 4 important spots that you need to adjust:

1. The make select list's definition (it is similar to my original suggestion)
2. The make's select lists Init- and Actionscripts in its advanced tab.
3. The model select list having an fake definition, otherwise it wouldn't be rendered
4. The actual code to retrieve the model data in form => advanced => more options => Form Pieces

It basically works like this:

When the form loads, the Initscript populates the model list using an ajax call onto the form's url location, passing the ID of the make.

The Form Piece listens to the make post value, if there is any, it checks the model database table using the make and returns all models for it as json_encoded string.

On success, the ajax call populates the model list based on the return.

The action script does the same, except it listens for a change event on the make list before it fires.

I am sure you will be able to adjust that to your needs and please let me know if you need further assistance.

File Attachment:

File Name: makemodels...tion.zip
File Size:10 KB


Regards,
Markus
Attachments:
The following user(s) said Thank You: atomicjp

Please Log in or Create an account to join the conversation.

Form Options / more options 4 months 3 weeks ago #241319

  • Topic Author
  • atomicjp
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
thanks again,
but now i have another problem.
because in this case i have to use 4 diferent select list boxes
and all depends on the selection made in the previous, and i have to display names and variable that uses the relationship form the table its and idnumber.

can you help me?

Please Log in or Create an account to join the conversation.

Form Options / more options 4 months 3 weeks ago #241387

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 803
Hi,

since this is a very custom case I need to ask you to precisely tell us about your requirements. This also includes information like:

- where is the data coming from? (e.g. how many tables and columns are involved)

- are there any rules that should apply when selecting anything?

The more information you can give (in a well understandable way), it will be easier to assist.

Regards,
Markus
The following user(s) said Thank You: atomicjp

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.049 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!