OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



problem with forms

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.

problem with forms

Postby dinesh » Sat Jun 16, 2007 2:06 am

hi,

I modified the code in templates/user/profile.tpl, to include Affiliation and mailing address as "required" fields by inserting
Code: Select all
required="true"
. And I synced the same with registration.tpl also as explained in the code.
But after registration users are able to delete those newly added "required data" and able to save. How to disallow this? Is the data not written to the database?

please help.

thanks and regards,

Dinesh
dinesh
 
Posts: 23
Joined: Tue Jun 05, 2007 12:02 pm
Location: Bangalore

Postby asmecher » Sun Jun 17, 2007 2:58 pm

Hi Dinesh,

To make a field required, you need to change the .tpl file (as you've done) so that the user is notified that the field is required; you also need to add a new check to the form class (e.g. for the registration form, classes/user/form/RegistrationForm.inc.php). These look like:
Code: Select all
 $this->addCheck(new FormValidator($this, 'username', 'required', 'user.profile.form.usernameRequired'));
...in this case, the check makes sure that the username field is specified.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 7743
Joined: Wed Aug 10, 2005 12:56 pm

Postby dinesh » Wed Jun 20, 2007 11:26 am

hi,

thanks a lot. I modified that. i am now understanding more on the structure of OCS.
Thank you very much.

regards

Dinesh
dinesh
 
Posts: 23
Joined: Tue Jun 05, 2007 12:02 pm
Location: Bangalore


Return to OCS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest