Dropdown menu in salutaion field in user registration form


Is there any simple method to change salutation text field to drop down menu in user registration form. I am using ojs 2.4.2.

Workable code will be highly appreciable.


Ganesh Sharma

Hi @ganeshsharma,

You’d need to work with the Smarty templates and possibly PHP code as well, depending how you do it. The most relevant template is templates/user/register.tpl.

Alec Smecher
Public Knowledge Project Team

@asmecher @ganeshsharma I am working same this now. I thought @ganeshsharma you solved already. I did in that way. I changed salutation code in register.tpl.

{fieldLabel name="salutation" key="common.salutation"} {html_options options=$salutations selected=$salutation}

Then I add in RegisterForm.tp.

$salutationDao =& DAORegistry::getDAO(‘SalutationDAO’);

$salutations =& $salutationDao->getSalutations();

$templateMgr->assign_by_ref(‘salutations’, $salutations);

I create SalutationDAO class . I just copy from CountryDAO and changed it .
Then I create salutation.xml and create salutations array. And put data. I copy from country.xml class and modify it.
Run it .
I got unrecognized DAO SalutationDAO. Please let me know why I am getting this error.