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
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

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: 873
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: 873
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: Bing [Bot] and 2 guests