Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Rienk Vlieger
  2. F2C Search settings
  3. Monday, 18 April 2016
  4.  Subscribe via email
Form2Content 6.13.0
Form2Content Search 6.5.0

Hi,

Is it possible in the searchmodule to display a second search field depending on the choice made in the first search field?

For exemple: in the first field one can choose a main-category. In the second field subcategories are shown depending on the choice of the main-category.

Regards,
Rienk
Responses (16)
Accepted Answer Pending Moderation
Hi Rienk,

I have a custom solution made by a programmer in which I have several lists and the choice of the first list (drop-down) determines which second list (drop down) is shown. It works via a template override form mod_f2csearch. The only thing is that I have to dive into the code somewhere to find it..

Is this function what you are looking for?

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 1
Accepted Answer Pending Moderation
That is exactly what I'm looking for!
Hope you will find some time to find it!

Regards,
Rienk
  1. more than a month ago
  2. F2C Search settings
  3. # 2
Accepted Answer Pending Moderation
The solution is build on this page: http://www.nbav.nl/
Last option "bestemming" choice will update search results and display another drop down depending on first choice.
The javascript is within the module. It's a custom job meaning that the field values need to be changed and the js added via a module override.

Hope this helps. The programmer in question is on holiday until beginning of may.

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 3
Accepted Answer Pending Moderation
Hi Patrick,

I understand that the second field is hidden in the css, untill a choice in the first field is clicked.
Then the second field will show with a 'display: block;' in the css.

Could you get the javascript when the programmer in question is back of do I have to ask nbav.nl myself?

Regards,
Rienk
  1. more than a month ago
  2. F2C Search settings
  3. # 4
Accepted Answer Pending Moderation
Please DO NOT contact NBAV that's a client!

The JS is in the page code! Simply copy paste it (and look for the field values)..... like I said, it's in the module html part.

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 5
Accepted Answer Pending Moderation
Sorry, you confused me a bit by telling the programmer was on holiday.

I see several JS scripts it the code. I'm not a programmer so please tell me which script. Then I wil figure it out (;-)

Regards,
Rienk
  1. more than a month ago
  2. F2C Search settings
  3. # 6
Accepted Answer Pending Moderation
Please find attached two files (unzip first). The uikit.php is the module override file. Place both under root/template_name/html/mod_form2contentsearch/

Check differences with original files and field values!

regards,
Patrick
Attachments (1)
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 7
Accepted Answer Pending Moderation
Patrick. you're a hero!

Thanks!

Regards,
Rienk
  1. more than a month ago
  2. F2C Search settings
  3. # 8
Accepted Answer Pending Moderation
patrick,

I have to border you with one more thing...

In the JS there's this function:

function onBestemmingChange(e) {
var newSelection = selectors[0].$select.val();

if (newSelection === selected) {
return;
}

if (selected) {
selectors[selected].$select.val('');
selectors[selected].$div.hide();
}

if (newSelection) {
selectors[newSelection].$div.show('slow');
}

selected = newSelection;
}

if (selected) {
selectors[selected].$div.show('slow');
}

selectors[0].$select.on('change', onBestemmingChange);
});

Could you tell me where this word 'Bestemming' is refering to?
Is this the Field name of the Content Type Field?

Regards,
Rienk
  1. more than a month ago
  2. F2C Search settings
  3. # 9
Accepted Answer Pending Moderation
By the looks of it that's the name of the function. Since the bestemming (Dutch for Destination) is what we want to select the programmer simply used the word while programming the onchange function.

Please use your Firebug (or similar html element analyser) to see the field names in the module/page html.
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 10
Accepted Answer Pending Moderation
Sorry Patrick,

I tried a lot but still I don't get it working. :(
Could you have a look for me, please?
I copied the right ID's, changed the path to the .js, etc. No problem.
Clicking on one of the 4 options in - Categorie - should result in a extra field:

http://staaltest.nl/verzuim/index.php/partners

Regards,
Rienk
  1. more than a month ago
  2. F2C Search settings
  3. # 11
Accepted Answer Pending Moderation
Hi Rienk,

No I can't because I am not a programmer, sorry.
I have given you code that was used on one of my websites but developed by someone else as previously referred to (and for which I paid).
It requires some JS understanding to implement. I am sure a (befriended) programmer will be helped with the code.

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 12
Accepted Answer Pending Moderation
Ok, thanks!

BTW, it's not possible to upload attachments in this forum?
  1. more than a month ago
  2. F2C Search settings
  3. # 13
Accepted Answer Pending Moderation
which form??
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 14
Accepted Answer Pending Moderation
I meant forum, sorry.
  1. more than a month ago
  2. F2C Search settings
  3. # 15
Accepted Answer Pending Moderation
You can (or should be able to), but not .js, .php etc.... safety thing ;)
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Search settings
  3. # 16
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.