TOPIC:

Dropdown list css question 7 months 3 weeks ago #278189

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hi,

It's not working, but i tried Tihana's hint and it works!


super! :)

Now we need to change the color of the label in the select list, right?

Regards,
Mirko

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

Dropdown list css question 7 months 3 weeks ago #278190

  • Topic Author
  • cvrak
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 15
  • Thanks: 0
Yes, like the attached pic i send it again
Thanks
Chris

Mirec wrote: Hi,

It's not working, but i tried Tihana's hint and it works!


super! :)

Now we need to change the color of the label in the select list, right?

Regards,
Mirko

Attachments:

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

Dropdown list css question 7 months 3 weeks ago #278191

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hi,

oke, it is little complicated to perform, but I will give my best to do it

if you have more questions, feel free to ask!

Regards,
Mirko

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

Dropdown list css question 7 months 3 weeks ago #278198

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hi,

I have the solution for this your problem, using optgroup

the solution is :

You can do this by definig your "select from list" element list like this:
0;0;0

this is needed, at least one option, so the select element get's built on start. We will remove this option by code in the bellow script.

Now go to your select list element> init script> Form entry:
function ff_selectFromListELementName_init(element, condition)
{
element.options[0]= null;

var optG = document.createElement("optgroup");
optG.label = "First Optgroup";
optG.appendChild(new Option('Option1', 'value1', 'none', false, false));
optG.appendChild(new Option('Option2', 'value2', 'none', false, false));
element.appendChild(optG);

optG = document.createElement("optgroup");
optG.label = "Second Optgroup";
optG.appendChild(new Option('Option3', 'value3', 'none', false, false));
optG.appendChild(new Option('Option4', 'value4', 'none', false, false));
element.appendChild(optG);
	
}

Instead 'selectFromListELementName' insert name of your select list.

If you need more help with creating optgroup, let me know and I will help you.

Let me know!

Regards,
Mirko

Attachments:

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

Dropdown list css question 7 months 3 weeks ago #278302

  • Topic Author
  • cvrak
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 15
  • Thanks: 0
Hi Mirko,
I've followed your suggestion and its ok. I created a new optgroup without problem.
Also I deleted the "element.options[0]= null;" and insdead of 0;0;0 I put "0;Select city;Select city". It works. Are we ok?

Can you tell me how can I change the color and the background of labels and options? I suppose I have to add some css rules, please can you give me an example?

Thanks for your help
Chris


Mirec wrote: Hi,

I have the solution for this your problem, using optgroup

the solution is :

You can do this by definig your "select from list" element list like this:

0;0;0

this is needed, at least one option, so the select element get's built on start. We will remove this option by code in the bellow script.

Now go to your select list element> init script> Form entry:
function ff_selectFromListELementName_init(element, condition)
{
element.options[0]= null;

var optG = document.createElement("optgroup");
optG.label = "First Optgroup";
optG.appendChild(new Option('Option1', 'value1', 'none', false, false));
optG.appendChild(new Option('Option2', 'value2', 'none', false, false));
element.appendChild(optG);

optG = document.createElement("optgroup");
optG.label = "Second Optgroup";
optG.appendChild(new Option('Option3', 'value3', 'none', false, false));
optG.appendChild(new Option('Option4', 'value4', 'none', false, false));
element.appendChild(optG);
	
}

Instead 'selectFromListELementName' insert name of your select list.

If you need more help with creating optgroup, let me know and I will help you.

Let me know!

Regards,
Mirko

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

Dropdown list css question 7 months 3 weeks ago #278303

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hi,


Hi,

Here is a solution for add background color:
Go to Form properties > Advanced> More options. Then go to Form pieces and in the Before form select Custom.

Then in the code area below put the following code:
echo '
<style>
option {
    background-color: black !important;
}
</style>
';


For a change in the label color of the select list, I need to check it

Let me know, whether this works for the background color

Regards,
Mirko

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

Time to create page: 0.080 seconds

Support Chat

Join our Discord chat and enter the Crosstec channels for live-support, chat forums and interact directly with the community!

After joining, please enter the Crosstec Area and use the #crosstec-support or #crosstec-general channels.

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

Subscribe to news and updates!

Special Offer

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!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!