Creating the 'Sign the Guestbook' -page with Template layout |
Create a form as follows:
<form method="POST" action="$writeAdd">
In form you can use the following INPUT -fields:
| checkbox | private | (value = 1) | Selected => private message |
| text | name | 64 | Writers name |
| text | email | 64 | Email address |
| text | city | 64 | City |
| text | hpName | 128 | Homepage name |
| text | hpURL | 128 | Homepage address (URL) |
| text | text1 | 64 | Free text 1 |
| text | text2 | 64 | Free text 2 |
| text | text3 | 64 | Free text 3 |
| select | selection1 | | Free selection field 1 |
| select | selection2 | | Free selection field 2 |
| textarea | message | (5 kb) | Message |
You can set the default values for the fields (excluding the selection fields) by referencing the field names. e.g. <input name="name" maxlength="64" type="text" size="40" value="$message.name"> When the user first comes to the write page, all the values are empty. When the form is submitted and there occurs an error (a required field was missing, or some other error), the field values are set to whatever the user wrote to them, so he/she doesn't have to retype them.
Required fieldsIf you want that the visitor has to fill some question fields, add the field names to the form as hidden fields as follows: Field name+"Req", value="1". E.g. The field 'name' is required: <input name="nameReq" value="1" type="hidden">
|