Adding number and date fields to swiftpage surveys

I was recently asked a question about adding non-standard field types to swiftpage surveys, such as date, time, number, password, etc. After a short amount of tinkering I found a semi-complex workaround that gets the job done to some extent. I was able to update an ACT contact with a number type, imported through the survey created with a number field.

  1. Add a few text fields to the surveys which you want to be your date/number fields, the same way you would normally add any other. Give them a question name, options, put in the right order, etc. Choose text for the type, we will be editing that later.
  2. View survey link in new tab. View page source.
  3. Copy/paste source into your text editor. I always recommend Notepad++.
  4. We can trim a lot out of this source code for the survey. We are only interested in the main table which contains the form, which is typically somewhere around line 30 or so. Look for the “BioWind” span. You’ll want to copy the full <TABLE> section which is contained within. The rest of the header and a few lines of the footer can be trimmed out.
  5. Find the questions you want to edit to be your new field type. Check for <input type=”text”> as being one of the attributes.
  6. Alter the input type for the appropriate questions to be the type you’re looking for. Simply change “text” to the new value, such as “number”.
    • Here is a complete list of all supported field types in HTML5: button, checkbox, color, date, datetime, datetime-local, email, file, hidden, image, month, number, password, radio, range, reset, search, submit, tel, text, time, url, week
  7. Look in the opening tag for the <form>. Find the action=”” attribute. This is the URL the survey results are sent to. Modify the action=”” URL in the opening <form> tag to be a complete path rather than referenced, so that the results will be updating the same survey. Just change action=”/username.account/SurveyName/Survey.aspx” to action=”http://www.swiftpage.com/username.account/SurveyName/Survey.aspx”.
  8. Save file as .html and test it. Open it in a browser and give it a test fill. Swiftpage should accept the numeric and date values into its text fields you set up earlier.
  9. You’ll need to find a new way to host the new code block you have edited. Maybe embed your new survey source code on your own site. Alternatively, add this survey code to a template, and host that template as a landing page, and use that as the survey page.
  10. Link to the survey in a test email. Ensure for your “survey result options” that your fields are updating to the proper act fields, and then test updating survey responses within ACT.

Not the most elegant solution, but if it works! Hope this will be of help.

Leave a Reply

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