cakephp 下拉列表

发布于 2024-08-23 11:36:59 字数 201 浏览 9 评论 0原文

这是我的编辑页面中的下拉列表链接 编辑时它会自动选择朋友,但我希望它默认显示“选择您退出的朋友”(每当页面加载时)..

echo $form->input('PostCard.friend_id',array('label'=> ;__l('好友名单'),'empty'=>__l('选择现有好友'),'options'=>$friends));

this is the dropdown list link in my edit page
when editing it selects the friend automatically, but i want it shows 'select your exiting friend' by default(whenever the page loads)..

echo $form->input('PostCard.friend_id',array('label'=>__l('Friend Name List'),'empty'=>__l('Select Your Existing Friend'),'options'=>$friends));

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我喜欢麦丽素 2024-08-30 11:36:59

您可以覆盖选定的值: http://book.cakephp.org/view/199/选项-选定

echo $form->input('PostCard.friend_id',array('label'=>_l('Friend Name List'),'empty'=>_l('Select Your Existing Friend'),'options'=>$friends, 'selected'=>false));

You can override selected value: http://book.cakephp.org/view/199/options-selected

echo $form->input('PostCard.friend_id',array('label'=>_l('Friend Name List'),'empty'=>_l('Select Your Existing Friend'),'options'=>$friends, 'selected'=>false));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文