Pass checkbox values to database

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

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.
Posts: 13
Joined: Mon Mar 24, 2008 1:02 pm

Pass checkbox values to database

Postby Rames » Tue Apr 22, 2008 10:45 am

I'd like to implement a checkbox in the article submission process that will allow the submitting author to pass information to the database, so that editors can view checked items in the editing phase. Specifically, the author is indicating whether or not they want to participate in an optional open discussion forum on our journal (I'd rather do this by implementing a new checkbox than with comments to the editor). I have successfully added metadata from a form text area (see post #p10689 in this forum), but could use some pointers as to how to pass checkbox values to the db. I took a look at the checkbox on step 5 of the submission process, but it didn't seem like this was passing information to the database.


ojs v2.2, php v5.2.4

Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am

Re: Pass checkbox values to database

Postby jmacgreg » Tue Apr 22, 2008 4:28 pm

Hi Rames,

I've moved this to the Development forum, as it's not so much a support question. I'll also be passing it on to the developers to see if they have any advice.


Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm

Re: Pass checkbox values to database

Postby smiri » Tue Apr 22, 2008 10:14 pm

Hi Rames,

As Alec mentioned in the post below, those are the files you need to change.

And for example, in this file: classes/submission/form/

You will need to add a field in readInputData() function to read what the user entered. Then in the execute() function, you can use something like the line below to access the read data and set it using the articleDAO functions:
$article->setAbstract($this->getData('abstract'), null);

Of course you would also have to add a function in Article class file and the DAO file to get and set the new field.

I hope this can get you started.


Return to “OJS Development”

Who is online

Users browsing this forum: No registered users and 2 guests