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.
- 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.
- View survey link in new tab. View page source.
- Copy/paste source into your text editor. I always recommend Notepad++.
- 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.
- Find the questions you want to edit to be your new field type. Check for <input type=”text”> as being one of the attributes.
- 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
- 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”.
- 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.
- 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.
- 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.