OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Asterisk next to "required fields" (create new account)

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Asterisk next to "required fields" (create new account)

Postby funkologic » Fri Jan 20, 2012 1:06 am

Hi:

I am running OCS 2.3.2 and I want to customize the form to create a new account. In particular, I want the country to be a required field.

I have followed the instructions on these topics in the OJS forum:

viewtopic.php?f=8&t=1244
viewtopic.php?f=8&t=7495

and I have managed to make that field required, so that part is working fine.

However, I did not manage to add the asterisk so that a new user does not know that that field is required. Any suggestion, please?
funkologic
 
Posts: 3
Joined: Wed Jan 11, 2012 4:21 am

Re: Asterisk next to "required fields" (create new account)

Postby JasonNugent » Thu Jan 26, 2012 7:59 am

Hi funkologic,

Did you add the required="true" attribute to the fieldLabel in the template? It's discussed in the second thread you linked to.

Cheers,

Jason
JasonNugent
Site Admin
 
Posts: 910
Joined: Tue Jan 10, 2006 6:20 am

Re: Asterisk next to "required fields" (create new account)

Postby funkologic » Thu Jan 26, 2012 9:12 am

Hello Jason:

thanks for the kind reply.

I am not sure where and how to add the code. This is what I have up to this point:

[ProfileForm.inc.php]:

Code: Select all
$this->addCheck(new FormValidator($this, 'country', 'required', 'user.profile.form.countryRequired'));


[CreateAccountForm.inc.php]:

Code: Select all
$this->addCheck(new FormValidator($this, 'country', 'required', 'user.profile.form.countryRequired'));
funkologic
 
Posts: 3
Joined: Wed Jan 11, 2012 4:21 am

Re: Asterisk next to "required fields" (create new account)

Postby JasonNugent » Thu Jan 26, 2012 1:09 pm

Hey funkologic,

The required="true" bit goes in the smarty template, where you added the field to the form. You'd look for the {fieldLabel....} representing the new field you added.

Have a look at the second code block in this post:

viewtopic.php?f=8&t=7495#p29084

Regards,

Jason
JasonNugent
Site Admin
 
Posts: 910
Joined: Tue Jan 10, 2006 6:20 am

Re: Asterisk next to "required fields" (create new account)

Postby funkologic » Fri Jan 27, 2012 7:34 am

I've modified the template as you suggested and now the asterisk is visible.

You have been extremely helpful, Jason, thanks a lot!
funkologic
 
Posts: 3
Joined: Wed Jan 11, 2012 4:21 am


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests