Index

  1. Home
  2. Docs
  3. Index
  4. Data Projects
  5. Registration page

Registration page

Follow these steps to add a simple registration page to your website:

  • Create a table
  • Create a Data Project
  • Add a page (type = table)
  • Set Allow Insert? to Only
  • Copy the shortcode of the registration page
  • Paste the shortcode into your web page

A registration page allows users to add a row to your registration table. The registration can be updated until the user leaves the registration page. After closing the page, the data is no longer retrievable for public users. To administer registrations, you need to create an additional CRUD page.


Here is the create table script for the demo table:

CREATE TABLE `registration`
(`id` int(10) NOT NULL auto_increment
,`firstname` varchar(100) NOT NULL
,`lastname` varchar(100) NOT NULL
,`gender` enum('','Female','Male')
,`birthdate` date NULL
,`address` varchar(100) NULL
,`zipcode` varchar(100) NULL
,`city` varchar(100) NULL
,`state` varchar(100) NULL
,`country` varchar(100) NULL
,`email` varchar(100) NOT NULL
,`phone` varchar(10) NOT NULL
,`message` text NULL
,`interest` set('','Sports','Music','Art')
,PRIMARY KEY (`id`)
);
Was this article helpful to you? Yes No

2 Replies to “Registration page”

  1. I need to know if I can do conditional formatting with this. For example. I need to gather a companies Industry sector (good or services). based on that answer, I need to focus a second drop down box to further segment the business. Is this possible.? I need to take this conditional formatting down 3 levels.

    1. Hi David,

      From what I understand from your question, I think you can do this with the plugin. However, by default, each drop down list on a form is an individual item on its own. You’ll need to add your own logic to connect them to each other. There are two ways to do this. You need to have programming skills in PHP and JavaScript for both.

      Alternative 1:
      Use hook wpda_after_simple_form to add your own javascript events to your drop down lists. More information about this hook can be found here:
      https://wpdataaccess.com/2020/01/29/action-hook-wpda-after-simple-form-to-add-custom-elements-to-end-of-data-entry-forms/

      Alternative 2:
      Create your own PHP class which extends plugin class WPDA_Simple_Form and add your own logic to that class. Make sure WP Data Access is loaded before your code is executed, which is needed to assure the availability of class WPDA_Simple_Form. It might be an idea to have a look at class plugin WPDA_Publisher_Form. The Data Publisher is implemented as an subclass of class WPDA_Simple_Form as well, and it uses its own JavaScript code to add functionality as well. This is comparable to your situation.

      Hope this helps! ๐Ÿ™‚

      Best regards,
      Peter

Leave a Reply to David Thompson Cancel reply

Your email address will not be published. Required fields are marked *