« Return to TrackVia.com
TrackVia

Web Forms

Tool

Web forms that submit into a TrackVia database

Description

Any table in TrackVia can provide one or more web forms that you can publish to a web page (website, intranet, Sharepoint, etc.) and each form submission is automatically created as a new database record.

Notes

This article provides instructions for adding to your web page a public form that will populate a TrackVia database. Successfully integrating a TrackVia web form requires that you have (or quickly gain) basic familiarity with HTML and publishing an HTML document to a web server.

  • Copying and pasting HTML into your website
  • Changing the form's appearance, including removing fields and setting defaults
  • Using a custom response template
  • Redirects and email notification

 

Copy and paste HTML into your web page

The first two steps are to generate HTML for a web form, and copy it and paste it into your web page using your favorite HTML editor. (If you want to quit here, you can – you now have a fully-functioning, albeit unattractive, public TrackVia form!) TrackVia offers two different form layouts that you can find by clicking the Web form link in the Tools pane. The questions above answers layout has field names and input elements in a single line down the page. The side-by-side layout is arranged in a table, with field names on the left and input elements on the right. Both of these layouts are very basic, and you'll probably want to modify the HTML to improve your form's appearance. You can do this in several ways:

  • You may change the appearance of any form input or its label – for example, by putting input elements in a table, altering their size, or add stylesheet "class" attributes. TrackVia only requires that the input elements have the correct name and type.
  • You may also remove any input element. TrackVia will assign a (none) value to any table field that's not represented in the form. This is useful for internal tracking fields, such as "status" or "assigned to." You can also remove the time parts of a date/time field. Note, though, that you must not remove the datasetid or securitycode hidden inputs. And if you remove a field that you have indicated is required on the Edit Table page, users will see an error.

You may set defaults for any removed or internal fields by changing the input type to "hidden." For example, if the form contains a "status" drop-down list that you'd like to remove and set to a default of "not started," simply replace its entire <select>...</select> block with


<input type="hidden" name="text036" value="not started">


Be sure to keep the name of the input element the same – in this case, text036.

  • Date/time defaults should be in YYYY-MM-DD HH-MM-SS format:
  • <input type="hidden" name="datetime000" value="2006-05-25 18:30:00">
  • Checkbox group defaults should use a value of on for each choice:
  • <input type="hidden" name="text072-volunteer" value="on">
  • <input type="hidden" name="text072-donor" value="on">
  • Uploaded file fields cannot have defaults.

Make sure to test your form with a variety of input values, including blank values, for each form element. Check the records that show up in your TrackVia table. TrackVia will provide basic type checking (numbers must be numbers, emails must be valid), and validate that required fields are not blank. If you desire more complex validation or back-end custom processing, please contact us. Charges may apply.

Using a Custom Response Template

TrackVia's error and confirmation messages are by default quite plain. However, when a record is submitted, TrackVia can send a response that looks and feels like your own website. To enable this, simply provide the public URL of the page containing your finished form, or upload the HTML file that contains your form. TrackVia will use either of these to construct a response template that looks like your site. When building the response template, TrackVia will replace everything between the <!-- #public_form# start --> and <!-- #public_form# end --> tags with the error or confirmation message. (These tags were generated for you in the previous step.) Make sure your entire form is contained within those tags, along with anything else you don't want to appear in the response, such as instructions or introductory text. Other tips:

  • If your webpage uses images from your site, they may not be referenced correctly when the template is delivered from a TrackVia domain. To fix this, add the following at the beginning of the section of your HTML file: <base href="http://www.your-domain-name.com" />
    http://www.your-domain-name.com
    Be sure to replace your-domain-name with your website's actual domain name. This step is done for you if you provide a public URL, but you'll have to do it yourself if you upload an HTML file.
  • Similarly, you may need to add http://www.your-domain-name.com/ to other parts of your webpage:
    • the src attribute of any JavaScript <script> elements
    • the href attribute of any stylesheet <link> elements
    • the url() part of any style attributes in any elements
    • the location.href=... part of any JavaScript event handlers (onclick, etc.)

    If these are required, you'll have to use the upload-HTML technique, rather than the public URL technique. Try the <base href="..."> trick first, though, as often that is sufficient.

Redirects, Email Notification, and Cross-Submitting

Another option for the confirmation page is to supply the URL of your own confirmation page. If you add a hidden input element to your form like this:

<input type="hidden" name="redirect" value="http://www.your-own-site.com/thankyou.htm">

then TrackVia will redirect the user to the provided URL when the form is submitted. (Note that you still may want to upload a response template for TrackVia to use for error messages.) You can also have a copy of each form submission sent to you by email. If you add a hidden input element to your form like this:

<input type="hidden" name="emailcc" value="you@whatever.com">

then TrackVia will send a copy of the record that gets created to the email address specified. You can also specify multiple email addresses in the value attribute, separated by commas. To change the subject, from name, or from address of these emails, use similar hidden inputs called emailcc_subject, emailcc_fromname, and emailcc_fromaddress. Finally, you can also have a website form cross-submit data into a second table. For example, suppose you have a website form that submits into a table called Feedback. You'd like Feedback submissions to cross-submit into a table called Mailing List. To do this, add the following hidden input to your Feedback form: input in your form:

<input type="hidden" name="crosssubmit" value="Mailing List">

You can list more than one cross-submission table by separating the table names with commas. In each additional table, only those fields whose names and data types match the original table will be populated. For example, if Name, Phone, and Email are the only fields in the Feedback and Mailing List tables that have the same names and data types, they are the only fields that will be populated in the Mailing List record that gets created when a new Feedback record comes in. The new Mailing List record will include a link to its matching Feedback record in its Notes section. Our final advice: test it! Test your form in as many ways as you can think of. And please contact TrackVia Support if you have questions or problems.

Set up an auto-reply

TrackVia can send an automated email reply to the first email address in the table.  If there are multiple email addresses in your table you should ensure the one you want replies sent to is the first email field to appear in your table schema.  The auto reply uses templates which can contain placeholders to merge information from the record entered into either a plain text or HTML document similar to our Email Campaign tool and can have the From Name, From Address, and Subject you determine.  If you do not have an HTML editor or know how to create an HTML document it is strongly recommended you use a plain text template.