Giorgi625 VIP
Total posts: 655
17 Sep 2018 15:25

I have 3 fields in filter(all are fields, not category, not type, not tags). How can I set Motor field as required to select?

https://i.postimg.cc/BbHKqFBM/filter.png

Last Modified: 07 Feb 2019


pepperstreet VIP
Total posts: 3,837
19 Sep 2018 01:20

Hello Giorgi625,
I guess you have to create a custom filter template for that field. Which field are you using?

Each field has several filter templates.
See Components -> com_Cobalt -> fields -> YOURFIELD -> tmpl -> filter

Assuming you use select.php ?!
There should be a line with JHTML select.genericlist ...
That line should be responsible for the SELECT appearance.

You would have to pass the option(s) in that line...
I am no expert in Joomla API and JHTML, as far as I know, it should either be an array called $attribs
Or it is the 3rd parameter in that line, hence the null.

Isn't required set by a class name?
Then try to replace null with 'class="required"'

Hope this helps.


pepperstreet VIP
Total posts: 3,837
01 Feb 2019 01:35

Any success?


Giorgi625 VIP
Total posts: 655
01 Feb 2019 12:57

That project was postponed so I have not tried it yet.

If Client will ask me to continue working on it I will check.


Sergey
Total posts: 13,748
07 Feb 2019 11:18

Agree on customtemplate with additional JS code that check fields before submission.

Powered by Cobalt