In this section we explain the structures which represent the various input elements that provide forms.
</form>
).checkbox
with name Name, State=on if the checkbox is
initially checked (translates to an <input>
element).radio
with name Name (several radio buttons
which are interlocked must share their name), Value is the the
value returned by the button, if Selected=Value the button
is initially checked (translates to an <input>
element).text
, hidden
, submit
,
reset
, ...(translates to an <input>
element).<textarea>
environment).<select>
environment).
For example, in order to generate a form suitable for sending input to the previously described phone database handler one could type at a Prolog prompt:
?:- ['/usr/local/src/pillow/pillow.pl'], output_html([ start, title('Telephone database'), heading(2,'Telephone database'), $, start_form('http://www.clip.dia.fi.upm.es/cgi-bin/phone_db.pl'), 'Click here, enter name of clip member, and press Return:', \\, input(text,[name=person_name,size=20]), end_form, end]).
Of course, one could have also simply written directly the resulting HTML document:
<html> <title>Telephone database</title> <h2>Telephone database</h2> <p> <form method="POST" action="http://www.clip.dia.fi.upm.es/cgi-bin/phone_db.pl"> Click here, enter name of clip member, and press Return: <br> <input type="text" name="person_name" size="20"> </form> </html>