PHP Classes

input select options data attributes

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  Upcoming Visual HTML ...  >  All threads  >  input select options data attributes  >  (Un) Subscribe thread alerts  
Subject:input select options data attributes
Summary:input select options data attributes
Messages:5
Author:bartb
Date:2014-04-29 19:19:42
Update:2014-04-30 07:29:14
 

  1. input select options data attributes   Reply   Report abuse  
Picture of bartb bartb - 2014-04-29 19:19:42
Dear Manuel,

Thanks for your superb class.
Id like to add some data attributes to the options of a select input.
Is there a work-around to do this? The class only accepts a one-dimensional array for the options.

thanks! Bart

  2. Re: input select options data attributes   Reply   Report abuse  
Picture of bartb bartb - 2014-04-29 19:26:10 - In reply to message 1 from bartb
btw: I found your custom form_list_select_class, but I like to maintain the dropdown effect of a select button.
Is there another way to add attributes to the options?

  3. Re: input select options data attributes   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-04-29 20:01:27 - In reply to message 1 from bartb
You can use the ExtraAttributes parameter to specify an associative array of custom attributes.

  4. Re: input select options data attributes   Reply   Report abuse  
Picture of bartb bartb - 2014-04-30 06:19:04 - In reply to message 3 from Manuel Lemos
Thanks for replying.
The ExtraAttributes parameter adds attributes to the select tag. My object is to add attributes to the option tags. Is that possible?

  5. Re: input select options data attributes   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-04-30 07:29:14 - In reply to message 4 from bartb
Currently it is not yet possible, but you can create a custom input to implement the functionality as you need.