Sign In!
|
New User?Signup Now!
|
Forgot password?
Source Code 4 you
Home
Create Forum Topic
Check WebSite Rank
Publish Articles
UV Web Booster
Contact
Forum Type
Search Engine
.Net C# VB F# VC++
MonoPoject
Java J2EE
Zand Php Cake Php
Oracle Database Server
Mysql Database Server
DB2 Database Server
MSSql Databse Server
Javascript Ajax
Html Xml Xhtml
C Programming
C++ Programming
D Programming
CGI Programming
Perl Programming
Cobol Programming
Pascal Programming
Ruby Programming
Drupal Programming
Automobile
Software Testing
Linux Unix Mac Sun OS
Embedded Systems
Mainframe
IC Microcircuit Chip
Electronics Electrical
Hardware Netwarking
SAP ERP
Logical Reasoning
Human Resources
Science
Agriculture
Accounting
History
Pharmaceutical
Other Topic
Zand Php Cake Php
Posted by :
gimper daniel
showEmpty?
I am new to cake... i have been doing a lot of reading, but somethings
i still can't figure out.
This is what I have:
echo $form->select('State', array('NJ' => New Jersey', 'NY' => 'New
York'));
I want to remove the empty option of this select box. According to the
API I need to add $showEmpty = false to the code above.. but where do
I add it? I tried in several different locations and it won't work.
Thanks
Posted by :
Gonzalo Serva
Re : showEmpty?
The function's arguments are:
select($fieldName, $options = array(), $selected = null, $attributes =
array(), $showEmpty = '')
You only supplied the first and second arguments so if you want to
keep the defaults for the rest except for $showEmpty, you'd need to do
something like the following:
echo $form->select('State', array('NJ' => 'New Jersey', 'NY' => 'New
York'), null, array(), false)
(notice I kept the defaults "null" and "array()" for the arguments
between $options and $showEmpty)
If you have the better reply, then send it to us. We will display your reply after the approval.
Name :
Email Id :
Reply :