LINKING ------- If you want to link to the form from your webpage, use the following html code: Fill in our form If you want to form to appear in a new window, use the following html code: Fill in our form If you want to form to appear in a minimal "pop-up" window, use the following html code: Fill in our form EMBEDDING --------- The HTML file (website_2.htm) displays the form. If required, this HTML file can be customized, or you can embed the form in your own HTML file. These are the necessary steps to embed the form in an HTML page: 1) Ensure that the JavaScript file (website_2.js) and the resources folder (website_2_gfx) and all its contents are in the 'html folder' (http://www.whwebsolutions.com/Emailform/), and that the data handling script (website_2.php) and the form description xml file (website_2.xml) are in the 'data folder' (http://www.whwebsolutions.com/Emailform/). 2) Decide on the location inside your HTML page where you want to form to appear, and add the following tag at this location. This image reserves the space for the form and displays the temporary "Loading..." message. 3) Add the following lines just before the closing tag. This must be at the very end of the page, only followed by the closing and tags. The two numbers (100 and 200 in this example) are the x and y coordinates of the location where the form should appear. The values depend on the layout of your HTML page, but they should be chosen so that the form appears exactly over the "Loading..." image. This might take some trying out. The coordinates are relative to the left/top origin of your page. If your page does not use a rigid table structure or has centered elements, it won't be possible to provide these coordinates since the form will appear at different coordinates depending on the browser window size and font sizes. In this case, simply remove the 1st PRELOADING DATA --------------- You can programmatically pass data to the form. The data is displayed in the form's fields as default values. The data can be passed in two ways: 1) Pre-loading data through the query part of the URL. You can create individual links to your form which will then contain default data specific to this link. The link can be hard-coded, created dynamically (e.g. by JavaScript, server-side scripting such as ASP) or be the result of a html-form submission. The following example will cause the form's Text Input with the ID 180 to display "Hello" when the form is first displayed. http://www.yourserver.com/website_2.htm?qd_180=Hello The syntax of each parameter is: "qd_=". is the ID of the field in the form. See below for a complete list of all the fields in your form. is the data-value that this field should display. The must be URL encoded. If you want to pre-load more than one field, seperate them with a "&". Another example: http://www.yourserver.com/website_2.htm?qd_180=Hello+Friend&qd_181=Everything0Ok%63 2) Pre-loading through JavaScript parameters. You can add your own JavaScript code to the form's HTML file that determines the default data values of your form. The values can either be hard coded, calculated by further JavaScript code or implanted by server-side scripting (such as ASP, PHP, Perl). For example: The syntax of each parameter is: "window.qd_=". is the ID of the field in the form. All field ID's are listed at the end of this document. is the data-value that this field should display. RESPONSE DATA PROCESSING ------------------------ When the respondent presses the Send button on the form, the HTML page of the form submits the response data to a Server-Side script (website_2.php). This script accepts the data and processes it according to the settings you specified in during Publish process. Advanced users, however, might want to implement their own response data processing script: The html form submits the data using a HTTP POST. The post consists only of one field called "data". The value consists of one string that represents an XML document containing all the data from the form. Replace the existing PHP code with the following to display the raw XML document on screen: Each piece of response data is represented by a Field ID/Value pair. Most objects of the form only submit one field, others submit none or more than one. All field ID's are listed at the end of this document. We recommend using a 3rd party XPath parser for reading the XML (e.g. Php.XPath from SourceForge.net). The following script reads the fields into an array: FALSE, XML_OPTION_SKIP_WHITE => FALSE); $xPath =& new XPath(FALSE, $xmlOptions); $xPath->importFromString(rawurldecode($HTTP_POST_VARS["data"])); $Data = array(); $fieldsnode =& $xPath->getNode("/quaskformdata[1]/forms[1]/form[1]/data[1]/fields[1]"); foreach($fieldsnode["childNodes"] as $field) $Data[$field["attributes"]["id"]] = implode($field["textParts"]); 'Access the data by: = $Data[""] 'e.g.: echo("Hello " . $Data["80"]); ?> FIELD ID'S ---------- Page Control Name Control Type Field IDs ------------------------------------------------------------------------- Page 1 Text Input Text Input 3 Text Input1 Text Input 6 Text Input2 Text Input 8