OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Form error handling

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Form error handling

Postby kalpana » Wed Jun 20, 2007 12:57 pm

We have added two new fields to the author submission process and would like to make them 'required'. The process does not move to Step2, irrespective of what is filled. For the above 2 fields we also have routines that check if the inputs are valid and return 1 (valid). We are not sure how to incorporate these into the form validation process.

Thanks
Kalpana.

Modifications:

1. templates/author/submit/step1.tpl

<td width="20%" class="label">{fieldLabel name="abstract" required="true" key="rioja.submitterEmail"}</td>
<td width="80%" class="value"><input type="text" class="textField" name="submitterEmail" id="title" value="{$submitterEmail|escape}" size="30" maxlength="90" /></td>

2. author/form/submit/AuthorSubmitStep1Form.inc.php

$this->addCheck(new FormValidator($this, 'submitterEmail', 'required', 'author.submit.form.submitterEmailRequired'));
kalpana
 
Posts: 11
Joined: Wed Jun 20, 2007 11:57 am

Postby asmecher » Wed Jun 20, 2007 1:10 pm

Hi kalpana,

The modifications you've listed look good to me; you also need to add the submitterEmail variable to the list in the form class's readInputData function (and add the code to save the email address in the form's execute function, but that shouldn't prevent you from using the form check codes properly).

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: 7698
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests