Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Continue to message' email component

Status
Not open for further replies.

b00gieman

Programmer
Jul 9, 2007
60
DE
Hi!
I have recently added the option of attaching files to my email component.I have a question:what should I use so that after the user attaches the files he can contnue to write the message.What should I do to retain the text?
 
session? variable? What about attaching the item from a pop-up window?

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
The problem with the pop-ups is that some users could block the pop-ups,so...
 
Using the File input type doesn't require them to leave the page and come back. You only need that page change if you want to upload the file in a separate page load from the final submission of the email. If that is the case, then you will need the user to browser for their file, then do something to post the page. If your not going to do this in a popup or in a separate page then it might seem a little awkward to them to have to push two buttons to attach a file.

Separate Page:
Basically you would have an "attach" button on your email interface that is a submit button. Pressing this button submits the form to the next page to allow them to attach files. The next page writes all the posted values from the email to hidden fields and presents the user with file inputs to browse to files. Once they finish selecting files, they press a "back to email" button which submits all of the information back to the email page. You then need to handle the file uploads and put them somewhere until later, as well as re-filling out the form from the originally submitted email information and the attached email section (and hidden inputs) with the filenames they uploaded. When they hit the send button you will need to go get the uploaded attachments you stored somewhere based on the names or id's in your hidden fields and you will have everything you need to send the email.
You will probably want to build some sort of protection into the system, such as flagging their account when they are working on a draft, so that you can warn them or clean up after them after they attach a bunch of files and don't send the email. You would also need to work something out to make sure you don't overwrite one persons "myfile.txt" with another persons "myfile.txt" while your waiting for the original person to finish typing their email.

-T
 
I managed to solve the problem using a popup window.Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top