paul@676 | 1 | <?xml version="1.0" encoding="iso-8859-1"?> |
paul@676 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" |
paul@676 | 3 | "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> |
paul@676 | 4 | <html xmlns="http://www.w3.org/1999/xhtml" |
paul@676 | 5 | xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"> |
paul@676 | 6 | <head> |
paul@676 | 7 | <title>Questionnaire</title> |
paul@676 | 8 | <link xmlns:xlink="http://www.w3.org/1999/xlink" href="styles/styles.css" |
paul@676 | 9 | rel="stylesheet" type="text/css" /> |
paul@676 | 10 | </head> |
paul@676 | 11 | |
paul@676 | 12 | <body template:element="questionnaire"> |
paul@676 | 13 | <h1>Questionnaire</h1> |
paul@676 | 14 | |
paul@681 | 15 | <div template:if="@submitted = 'true'"> |
paul@681 | 16 | <p> |
paul@681 | 17 | Thank you for sending your answers! |
paul@681 | 18 | </p> |
paul@681 | 19 | </div> |
paul@681 | 20 | |
paul@676 | 21 | <form method="POST" action=""> |
paul@676 | 22 | |
paul@676 | 23 | <div class="questionnaire"> |
paul@676 | 24 | |
paul@676 | 25 | <div class="shadow"> |
paul@676 | 26 | |
paul@676 | 27 | <table class="questionnaire"> |
paul@676 | 28 | <tbody template:element="question" template:init="no"> |
paul@676 | 29 | <tr> |
paul@676 | 30 | <th class="question">Question #<span template:value="count(preceding-sibling::question) + 1">n</span></th> |
paul@676 | 31 | <td class="question"> |
paul@676 | 32 | <span template:value="@question-text">Question</span> |
paul@676 | 33 | |
paul@676 | 34 | <!-- Hidden state. --> |
paul@676 | 35 | |
paul@676 | 36 | <input template:attribute-field="question-text" type="hidden" name="..." value="..." /> |
paul@676 | 37 | <input template:attribute-field="choice-response" type="hidden" name="..." value="..." /> |
paul@676 | 38 | </td> |
paul@676 | 39 | </tr> |
paul@676 | 40 | <tr> |
paul@676 | 41 | <th class="response">Response</th> |
paul@676 | 42 | <td class="response"> |
paul@676 | 43 | <div template:element="choice" template:init="no"> |
paul@676 | 44 | |
paul@676 | 45 | <!-- Show a radio or checkbox if appropriate. --> |
paul@676 | 46 | |
paul@676 | 47 | <p xml:space="preserve"> |
paul@676 | 48 | |
paul@676 | 49 | <span template:if="not(response-type/@value = 'text')"> |
paul@676 | 50 | |
paul@676 | 51 | <!-- Show checkboxes. --> |
paul@676 | 52 | |
paul@676 | 53 | <input template:if="../@choice-response = 'multiple'" |
paul@676 | 54 | type="checkbox" |
paul@681 | 55 | template:attribute-button="selected,true,checked" |
paul@681 | 56 | name="..." value="..." /> |
paul@676 | 57 | |
paul@676 | 58 | <!-- Show radio boxes. --> |
paul@676 | 59 | |
paul@676 | 60 | <input template:if="not(../@choice-response = 'multiple')" |
paul@676 | 61 | type="radio" |
paul@681 | 62 | name="{template:other-attributes('selected', ..)}" value="{count(preceding-sibling::choice) + 1}" |
paul@681 | 63 | template:expr="../@selected = string(count(preceding-sibling::choice) + 1)" template:expr-attr="checked" /> |
paul@676 | 64 | |
paul@676 | 65 | </span> |
paul@676 | 66 | |
paul@676 | 67 | <span template:value="@response-choice">Choice</span> |
paul@676 | 68 | </p> |
paul@676 | 69 | |
paul@676 | 70 | <!-- Show a text box if appropriate. --> |
paul@676 | 71 | |
paul@676 | 72 | <p template:if="response-type/@value and not(response-type/@value = 'choice')"> |
paul@676 | 73 | <input template:attribute-field="response-text" type="text" size="40" name="..." value="..." /> |
paul@676 | 74 | </p> |
paul@676 | 75 | |
paul@676 | 76 | <!-- Hidden state. --> |
paul@676 | 77 | |
paul@676 | 78 | <input template:element="response-type" template:attribute-field="value" type="hidden" name="..." value="..." /> |
paul@676 | 79 | <input template:attribute-field="response-choice" type="hidden" name="..." value="..." /> |
paul@676 | 80 | </div> |
paul@676 | 81 | </td> |
paul@676 | 82 | </tr> |
paul@676 | 83 | </tbody> |
paul@676 | 84 | </table> |
paul@676 | 85 | |
paul@676 | 86 | </div> |
paul@676 | 87 | |
paul@676 | 88 | </div> |
paul@676 | 89 | |
paul@681 | 90 | <div class="operations" template:if="not(@submitted = 'true')"> |
paul@676 | 91 | |
paul@676 | 92 | <p> |
paul@676 | 93 | <input type="submit" value="Update" name="update" /> to refresh the form. |
paul@676 | 94 | </p> |
paul@676 | 95 | |
paul@676 | 96 | <p> |
paul@676 | 97 | <input type="submit" value="Finish" name="finish" /> when you are happy with |
paul@676 | 98 | your responses. |
paul@676 | 99 | </p> |
paul@676 | 100 | |
paul@676 | 101 | </div> |
paul@676 | 102 | |
paul@676 | 103 | </form> |
paul@676 | 104 | |
paul@676 | 105 | </body> |
paul@676 | 106 | </html> |