On Monday 05 January 2004 07:27, cheng saimun wrote:
Hi
I have a form which allows user to upload a file and then click submit. This will lead to a dtml-method which will prefom a series of manipulation. After this is done, this method will need to return to the previous page( ie. form ). My question is how do i add a 'UPLOAD SUCCESSFUL' message in this form if the file is uploaded? I mean when the user first enters this form, he should not see the message. Only when the successful uploading will he see it.
Hi, I think two ways are available to handle this : 1. make a redirection at the end of your DTML method, adding a parameter (for example, upload=1) saying that upload was OK. In your first form, you just have to check for this parameter and display a message accordingly (<dtml-if upload>...</dtml-if>). 2. I generally handle forms actions with Python scripts. At the end of these scripts, I add a volatile attribute to my object (self._v_modified=1) and in my DTML forms, I check for this attribute : if it exists, I display a message and then delete it immediately... Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net