Personal tools
You are here: Home Downloads Tutorials Python Create webforms Using DTMLmethods
nrcfoss logo aukbc cdac iit mumbai iit madras ow2 iosn flosscc
Digital India

Create webforms Using DTMLmethods

DTML Methods to create webforms and processing them



Create a  small   web form  using  DTML Method


say  a   DTMLMethod    Test_DTMLMethod




<dtml-var  standard_html_header>

<h2><dtml-var title_or_id><dtml-var document_title></h2>

<p> This is  the <dtml-var document_id> Document in the <dtml-var title_and_id> Folder.


<form action="display">

Name : <input type ="TEXT" name="name1"><BR>

Designation : <input type="TEXT" name="designation"><BR>

Group : <input type="TEXT"  name="group"><BR>

email : <input type="TEXT" name="email"><BR>

<input type="submit">



<dtml-var standard_html_footer>



CREATE another  DTMLMethod  say  say :  display

<dtml-var  standard_html_header>

<h2><dtml-var  titel_or_id><dtml-var document_title></h2>

<p> This is the <dtml-var doucment_id> Document in the <dtml-var title_and_id > Folder.


<dtml-in  expr="REQUEST.form.items()">

<dtml-var  name="sequence-key">:<dtml-var name="sequence-item"><br>


<dtml-var  standard_html_footer>

thats  all


when you call the  for Test_DTMLMethod    you can fill all the fields 

 submit     it  then You can   view the results  (disply DTMLMethod do it for you >


Thats it ..............


But you may wonder   what   REQUEST and RESPONSE

ZOPE  http requests and responses


Request and response objects life cycle

Data which can be extracted and edited



 You do not explicitly create or return HTTP response objects(in ZOPE Context).    An HTTP   REQUEST object always  has a HTTP response object associated  with it and the response object is created when the request hits the webserver.


The response is available for the whole lifetime of request processing. This effectively allows you to set and modify response headers in any point of code.


 If  you dont  know the  templating  mechanism of ZOPE  then you must refer    DTML & ZPT  articles.




Document Actions