cakephp选择选项属性 [英] cakephp select options attributes

查看:140
本文介绍了cakephp选择选项属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在select
中设置选项的title属性,如下所示:

i need to set the title attribute of the options in a select like this one:

<select name="webmenu" id="webmenu" onchange="showValue(this.value)">
  <option value="calendar" title="icons/icon_calendar.gif">Calendar</option>
  <option value="shopping_cart" title="icons/icon_cart.gif">Shopping Cart</option>
  <option value="cd" title="icons/icon_cd.gif">CD</option>
  <option value="email"  selected="selected" title="icons/icon_email.gif">Email</option>
  <option value="faq" title="icons/icon_faq.gif">FAQ</option>
  <option value="games" title="icons/icon_games.gif">Games</option>
</select>

我在食谱中找不到任何帮助

i didn't find any help in the cookbook

感谢

推荐答案

这里的第一个提示可能会给你一个如何使用表单助手的想法希望它:
http:// www.dereuromark.de/2012/03/01/some-new-crazy-cakephp-tricks/

the first tip here might give you an idea on how to use the form helper in a way you want it to: http://www.dereuromark.de/2012/03/01/some-new-crazy-cakephp-tricks/

基本上你需要使用更深的数组,提供标题和onchange属性。

basically you need to use a deeper array and provide the title and onchange attributes.

这篇关于cakephp选择选项属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆