Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2007, 06:26 AM
Registered User
 
Join Date: Aug 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default One button,two forms

Hello!
I have on the same page(asp page) two forms:one for uploading files and the other for sending the information from the current page as an email.I would like to send the email withe the uploaded file as an attachment.Is there a possibility of creating a "send" button which performs 2 actions:
1)uploads the files
2)sends the email
?

Thanks!


 
Old September 6th, 2007, 06:46 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi b00gieman!!
You can perform n number of action with single button,but u can perform only one at a time,then u will have to load the page or u can use iframe/ajax to post the data,if u don't want to reload the page then submit the original form.
choice is ur's
Based on the button'value field you can change the form's action="somepage.asp" ,
 plz free to change any langauge php/jsp/aspx etc as per ur requirement.

also be sure about enctype while uploading file .

Hope this will help you



Cheers :)

vinod
 
Old September 6th, 2007, 02:22 PM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I agree, I'd post under ASP, as there may be some other tricks you could employ or a different way of apporaching the problem that some ASP gurus could guide you to.

For example, in ASP.NET, you can program any number of things to happen when you click the button. You just keep programming them in the code behind inside the event handler for you button click and it will execute all the code you put in it.

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old September 6th, 2007, 02:32 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The simple answer is: you don't need 2 form actions. Uploading a file and sending user information through a form can all be done in one action; the only thing that could possibly limit this would depend on which ASP upload class you are using and how it is designed to work.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
 
Old September 12th, 2007, 01:40 AM
Registered User
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to selvakumar
Default

hw to use this method in PHP . do U guys knw.. please.. I need it urgent... Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Print 2 Forms using 1 Button matto336 Access VBA 4 September 26th, 2007 07:36 AM
Make a image button as default submit button toshi ASP.NET 1.0 and 1.1 Basics 1 June 1st, 2006 05:25 AM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.