Download Virthos User Manual

Transcript
Processing Forms
Virthos process basically all the elements that HTML allows in forms. The use of some elements may
affect how forms are automatically processed. The following topics will describe these points.
Check Boxes
An example: <input type="checkbox" name="active" value="1">
Most browsers transmit an <input> check box in a form only if the user has selected, or checked it.
To ensure that an element is transmitted even if it is empty, or not checked, you should declare a
hidden element of the same name before the actual check box, but without giving it a value. In the
above example, this would be:
<input type="hidden" name="active" value="">
If the field is actually selected, Virthos is sent two values for the same element (a null value and the
value “1”). In this case, the last transmitted value always takes precedence. That is why the hidden
form element needs to come before the check box element.
Submit Buttons
An example: <input type="submit" value="proceed">
The button that submits the form can also carry content with it. If you do not want to do this, do not
give the button a name attribute. You can still place a description on the button with the value
attribute.
File Selection Lists
An example: <input type="file" name="MyFile">
If you want to allow a form to permit a file to be uploaded, you must use the enctype="multipart/form-data" attribute for the <form> element. Otherwise, Virthos will not be able to process
the uploaded file. The first line of the form could look like this:
<form action="{{vtLink:-met='thanks',-act='mail'}}" method="post" ¬
enctype="multipart/form-data">
Multiline Entry Fields
An example: <textarea name="Tip" rows="4" cols="50">{{Tip:raw}}</textarea>
If a multiple-line entry field is to be assigned to a VirthosTalk user placeholder as soon as the form is
loaded, the placeholder must include the raw parameter, as in the above example. Without this
specification, each line break in the text being entered would cause a <br/> tag to be generated.
Virthos User Manual (08/25/2006)
107