Theron (Official Rep) April 04, 2012 22:11

Requirements for Posting Form Submissions

What are the basic requirements for posting form submissions to purlHub? For example, is the form name attribute required? What about the method attribute?
2 people have
this question
+1
Reply
  • This reply was removed on 2012-04-20.
    see the change log
  • This reply was removed on 2012-04-19.
    see the change log
  • Joel Bair (purlHub Specialist) April 20, 2012 16:54
    PurlHub handles FORM submissions via powerful data capture support embedded in the JSAPI. Any valid HTML FORM can be captured, associated with the personalization object, and exported at a later time.

    A FORM capture in purlHub is referred to as a "purl record". The basic requirements to setup a FORM with purlHub for data capture are as follows:


    1. Identify the FORM as a purlHub record via the FORM's ID attribute.


    2. Define the purlHub record name (aka: record label) to save the record as via the FORM's NAME attribute or the suffix of the ID attribute.


    3. Flag the elements to capture via each INPUT's CLASS attribute following the class flag naming convention.


    The only prerequisite is that personalization profile is associated with the document (e.g. A purl is loaded).

    Identifying the FORM as a purlHub record:

    Either set the FORM's ID to the default service identifier prefix, "phRecordForm", or define your own via the purlService config option "recordFormIdPrefix".

    Defining the record name:

    The simplest approach is to set the FORM's NAME. Alternately, add a suffix to the ID attribute separated by a hyphen or an underscore (e.g. id="phRecordForm-requestInfo"). Keep in mind, if you use both methods, the FORM's NAME takes precedence.

    <form id="phRecordForm-requestInfo" method="post">
    or

    <form id="phRecordForm" name="requestInfo" method="post">

    Flagging elements to pre-populate / capture:

    Add a class name to any element you wish to capture that follows the purlHub record class flag naming convention. {recordDataClassPrefix} + {recordName} + {propertyName} each separated by a hyphen or an underscore. The service default recordDataClassPrefix is "phRecordData". Or alternately, {recordDataClassPrefix} + {recordName} and set the element's NAME attribute. Keep in mind, in this case, the class flag propertyName suffix takes precedence in setting the property name. The following example flags the "firstName" input for data capture.

    <input type="text" name="firstName" class="phRecordData-requestInfo" />
    or

    <input type="text" name="name" class="phRecordData-requestInfo-firstName" />

    The FORM's METHOD and ACTION attributes are ignored by the purlHub data capture system and are free to be left out completely or used as the standard submit parameters. PurlHub's data capture interrupts the FORM's action, saves the data, and resumes any default submission.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited sad, anxious, confused, frustrated indifferent, undecided, unconcerned