Display Success Message if file is uploaded successfully.. HELP!
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. Thanks -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm
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
Thierry Florac schrieb:
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... What is DTML? ;)) Btw. if you set the attribute, every user viewing the resource at this time will see the message. I dont think this is what one wants.
Instead of redirecting or other magic its just easy to either place a value in REQUEST or call the template with another parameter to indicate this. Of use a seperate template with different layout if desireable Regards Tino Wildenhain
participants (3)
-
cheng saimun -
Thierry Florac -
Tino Wildenhain