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
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.

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.



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'));
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).

Alec Smecher
Public Knowledge Project Team
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest