The ref feature

Peter Karman edited this page Sep 7, 2018 · 5 revisions

The ref feature

You can use the KSVotes ref feature to send a reference code to initiate a registration session.

There are two ways to use ref.

GET request

If you enter into your browser, the your-org ref code will be saved and used for every registration until your browser is restarted.

POST request

You can host a form on your own server, in order to capture voter information before redirecting to

This example HTML snippet shows how you can create a form, gather input, and then redirect to KSVotes.

  <h1> test</h1>
   <form id="ksvotes" method="POST" action="">
     <input name="name_first" value="" > First Name
     <input name="name_last" value="" > Last Name
     <input name="dob" value="" placeholder="mm/dd/yyyy"> DOB
     <input name="email" value="" placeholder="" type="email"> Email
     <input name="phone" value="" placeholder="555-555-5555" type="tel"> Phone


 <script src=""></script>
   let $form = $('#ksvotes');
   $form.on('submit', function(ev, opts) {
     let options = opts || {};
     if (!options.payload_saved) {
       let $payload = $form.serialize();

       // pause our ksvotes form submit to save the data locally

       // send the data to our own server
         method: 'POST', // IMPORTANT to keep PII out of your server logs
         data: $payload,
         complete: function(data) {
           // pick up where we left off and continue to ksvotes
           $(ev.currentTarget).trigger('submit', { 'payload_saved': true });
     } else {
       alert("Sending data to KSVotes!");
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.