A new feature is required to store submitted form values in a user session. If the user visits the form page again, the question form fields will be populated with previously submitted values automatically.
Status: Approved Proposal
Key: draft -> approved proposal -> scheduled -> in development -> in testing -> complete -> released
This feature is not scheduled for development
Planned Release Version: 3.10.0 RC1
Currently, MySource Matrix only allows user to set default values for a Form Question. The Form Question fields will be pre-filled with the default values when the form page is being viewed. However, user submitted values are not stored and the default values will still be shown when the user visits the same page again later on.
A new feature is required to keep the submitted information stickied in a cookie so that the fields can be populated with the previously submitted values when the user visits the page again.
A new boolean attribute will be added to the Form Question asset. This attribute will be inherited by all Form Question Types. A dropdown box will then be added to the backend edit interface of each Form Question Type. Users can specify which Form Questions they want to make sticky by setting this attribute to 'Yes'.
When the form is submitted, the values will be stored inside the session data ($_SESSION predefined variable), if the sticky attribute is set to 'Yes' for a particular question.
The stuck values will use an array stored at $_SESSION['SQ_FORM_STICKY'], further indexed by asset ID of the current user and question name. This will allow fields with the same title across multiple forms to be populated with the stuck value.
Like other session variables, the stuck values remain until the end of the user's session, as determined by the Session Expiry rules in the Global Preferences screen.
When a custom form is visited, MySource Matrix will check the session data for any stuck values, and pre-fill the question fields accordingly when the title of a question exactly matches that of a sticky value. This will override any default values defined for the question.
The sticky attribute must also be set for a question on a different form to be automatically filled in this way.
This feature can work across multiple data types -for example, a stuck datetime question value can be stuck and used in a text field of the same name. If the stuck value is not valid for the question type of the destination field, the field will revert to the default value.
Note that using a sticky value for the Password question type is not appropriate, so will be disabled. Note also that it is not possible to implement a sticky value for the File Upload question type.