OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Required Registration Options

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.

Required Registration Options

Postby jcurtis » Fri Jun 14, 2013 7:57 am

Hi everyone,

I'm looking to add an another field into the "Registration Options" to make one of the options required, while registering for a conference. The conference requires people to agree to a of couple policies, but with the current registration options people can register without agreeing to the required policies. I realize I will need to rework some code in the the classes/registration/ folder, but I'm also not quite sure where to begin.

Cheers,

James
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Options

Postby asmecher » Fri Jun 14, 2013 2:46 pm

Hi James,

Do you have a blanket set of several policies that all registrants must agree to, or will these vary depending on the registration?

Reards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8860
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Options

Postby jcurtis » Mon Jun 17, 2013 4:37 am

Hi Alec,

We have two policies (ie. Cancellation policy and a Release of Information Policy) that a person must agree with to register for the conference. Someone who wants to register for a conference must agree with these policies in order to register online, otherwise they must sign up manually by contacting the email address that we provide.

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Options

Postby asmecher » Mon Jun 17, 2013 9:26 am

Hi James,

I suspect your easiest solution will be a template modification that introduces a) the policies and b) some quick JavaScript to make sure the checkboxes are checked before the form is submitted. If you don't want to modify the templates that directly (i.e. if you are running other conferences on the same system) then the cleanest way to do this would be to follow the lead of the Submission Checklist that authors are asked to confirm before they're allowed to submit papers. (This is configured in Setup.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8860
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Options

Postby jcurtis » Tue Jun 18, 2013 5:18 am

Hi Alec,

Thanks for the reply so soon! I will begin working on this and I will keep you posted about how it goes.


Cheers,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Options

Postby jcurtis » Thu Jun 20, 2013 11:24 am

Hi Alec,

I've been working in the userRegistrationForm.tpl file. The form element looks like this, <form action="{url op="register"}" name="registration" method="post" onsubmit="validateForm()">

I've placed the script in the head tags in the header.tpl file, but for some reason the function in never called. Any idea why this could be happening?

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Options

Postby asmecher » Thu Jun 20, 2013 11:27 am

Hi James,

If you're dumping JavaScript directly into a template file, make sure Smarty isn't trying to interpret it -- Smarty uses { and } for its own tags. Chuck your Javascript inside Smarty's {literal}...{/literal} tag, or use {ldelim} and {rdelim} instead of { and } (respectively). If this is indeed the problem you're running into, using "View Source" in your browser will show that your JavaScript is getting garbled before it reaches the browser.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8860
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Options

Postby jcurtis » Fri Jun 21, 2013 5:26 am

Hi Alec,

Again, Thanks for the help. What you said worked perfectly, I'm not sure why I didn't check smarty out in the first please but using the {literal} worked perfectly.

Cheers,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Options

Postby jcurtis » Tue Jun 25, 2013 5:50 am

Howdy,

For anyone else looking to achieve the same thing I did, here is a quick explanation of my solution.

*Note: This does not submit any data into the database. Our conferences require participant's to agree to two policies in order to register online, otherwise they have to sign up manually by contacting us.

File: templates/registration/userResistrationForm.tpl

First, in the Form tag I added onsubmit="return validateForm()" as to run the function before the form is submitted. For the policies that are required I added two check boxes a little down the page (Need to be inside the Form tags). Next I wrote the function that looks like this (removing the "User form validation" to save some space).

Code: Select all
{literal}
<script>
      function validateForm(){
         var x=document.getElementById("cancellationPolicy").checked;
         var y=document.getElementById("releaseOfInformationPolicy").checked;
         if(x==false && y==false){
            window.history.forward(-1);
            scroll(0,0);
            return false;
         }
         if(x==false && y==true){
            window.history.forward(-1);
            scroll(0,0);
            return false;
         }
         if(x==true && y==false){
            window.history.forward(-1);
            scroll(0,0);
            return false;
         }
         if(x==true && y==true){
            return true;
         }
      }
   </script>
{/literal}


The {literal} tags, as Alec mentioned, allow for the Javascript to run no problem. This bit of code grabs the two values of the form's (True or False) and then follows the set path. In this case, the form will only be submitted when the user agree's to both policies.

If any has any questions, I'd be happy to try and answer:)

Cheers,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Options

Postby asmecher » Tue Jun 25, 2013 8:30 am

Hi James,

Thanks for posting the details!

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8860
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Options

Postby jcurtis » Wed Jul 10, 2013 11:00 am

Hi!

I was wondering, in addition to this. How would you go about writing this information into the database?

I have a new problem where one of the Registration Options is called "Presentation Type", which could either be "Poster Presentation", "Oral Presentation", or "Not Presentation". A person registering should only be able to choose one of those items items. And it is essential that this information is displayed in the downloadable "Registrant Report".

Also, how does OCS store the information regarding whether or not a registrant checked the registration option?

Thanks!
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Options

Postby asmecher » Wed Jul 17, 2013 4:02 pm

(See http://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=10260 for a continuation of the last discussion.)
asmecher
 
Posts: 8860
Joined: Wed Aug 10, 2005 12:56 pm


Return to OCS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests