The "options" variable you send to the view (and the select tag
helper) is an array; after you do a "generateList()" to get your
options, just prepend a "Please Select" to it before you use a set()
call. There's also an option you can set in the select tag helper to
not use an empty option tag ('empty'=>false)On Mar 22, 11:12 am, "salimk786" <[EMAIL PROTECTED]> wrote: > This is just a thought. What if you create your own helper and extend > the html helper. Then you can override the base functions of select > and radio tags with your own. Then when you upgrade you really only > have to copy your helper over.... > > Just a thought. > > Salim. > > On Mar 22, 7:30 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > i try to delete the empty item in the dropdownlist and to insert an > > entry like "Please Select your Country". > > > I found > > thishttp://cake-php.blogspot.com/2006/09/21-things-you-must-know-about-ca... > > ------------------ > > Customizing HTML generated by the Helper > > > I needed to change the default <option> generated when I called > > $html->selectTag() to say something like "Please Select" rather than an > > > empty space (default). I also wanted radio buttons to have labels so > > the user doesn't have to click exactly on the radio button itself but > > can instead click anywhere on the text associated with it. > > Create the file /app/config/tags.ini.php and add the following: > > ; Tag template for a input type='radio' tag. > > radio = "<input type="radio" name="data[%s][%s]" id="%s" %s /><label > > for="%3$s">%s</label>" > > ; Tag template for an empty select option tag. > > selectempty = "<option value="" %s>-- Please Select --</option>" > > You can get a full list of available tags in /cake/config/ > > tags.ini.php. I wouldn't recommend modifying that file, however, > > because you could lose your changes when you upgrade CakePHP. > > --------------- > > > Is there an other possible solution ? > > > Thx > > > Oli --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
