How to Create Select Box in Registration Form in Joomla 1.6
I am using Joomla 1.6 and I have created a text field in registration form (which is driven by components\com_users\models\forms\registration.xml
) like this:
<field name="City" type="text"
description="COM_USERS_DESIRED_CITY"
filter="string"
label="COM_USERS_REGISTER_CITY_LABEL"
message="COM_USERS_REGISTER_CITY_MESSAGE"
required="true"
size="30"
开发者_C百科 />
Now I want to convert this text field (city) to select box, is it possible?
Yes, you want to change the type
attribute from "text" to "list" and then include the options you want available. For example:
<field name="City" type="list"
description="COM_USERS_DESIRED_CITY"
filter="string"
label="COM_USERS_REGISTER_CITY_LABEL"
message="COM_USERS_REGISTER_CITY_MESSAGE"
required="true"
size="30">
<option value="ny">New York</option>
<option value="chicago">Chicago</option>
<option value="la">Los Angeles</option>
</field>
精彩评论