• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Adding additional attributes to dropdown items?

Adding additional attributes to dropdown items? 9 years 4 months ago #33262

  • veeco
  • veeco's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hello

Is it possible to add additional attributes to the <option> tag inside the dropdown items?

for example

<option value="USA" data-phone='2513'>USA</option>
<option value="Canada" data-phone='2514'>Canada</option>

is it possible to add the "data-phone" attribute?

Thank you
The administrator has disabled public write access.

Adding additional attributes to dropdown items? 9 years 4 months ago #33264

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Yes, you can do this via a script placed within the PHP Scripts > Scripts called on form display area. The $formLayout variable contains the form's entire HTML. Example:
$formLayout = str_replace('option value="USA" ', 'option value="USA" data-phone="2513"', $formLayout);
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Adding additional attributes to dropdown items? 9 years 2 weeks ago #34845

Hi. This version does not work on me. What could be the problem?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!