ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 30th, 2003, 02:37 PM
kbrooks kbrooks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 kbrooks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
From Front Page form, send to database AND email

I have created a workorder form on Front Page that employees use to send in computer and other maintenance problems. In the form properties, I can choose to send the data to a database OR send it in an email, but can not choose both. We have it going to a database so we can better manage the data. But we would also like to send an email notification when a new record is added to the database. I've tried this in Access on the database end but came up emptyhanded. The Access gurus have suggested it's something I need to do in html on the form. My html is very limited so I'm hoping someone can tell me if this is possible, and how I would go about doing it. The HTML gurus suggested it was an ASP issue.

TIA!

Reply With Quote
  #2  
Old September 30th, 2003, 03:00 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
This is very doable, but not using the wizards in FrontPage. What you need to do is write a form handler page in asp. You will set the "action=" attribute of your form to the form handler .asp page. Then in that page you can write all the stuff you want to do with the form data, including emails, inserts, and the like. If you need help with this, post back.

Reply With Quote
  #3  
Old September 30th, 2003, 03:24 PM
kbrooks kbrooks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 kbrooks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I hate bugging people for help, but I'm afraid I do need more detail on this. Also, will I need to totally re-do my form, or can I modify it?

Reply With Quote
  #4  
Old September 30th, 2003, 09:15 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
You do not have to re-do your form at all. Simply change the form "action" tag to the name of the handler asp you will write. ie, if you named your form handler "formhandler.asp", then in the form, you would put "action=formhandler.asp". That takes care of the form itself. In the form handler page, google around for information on sending email with asp and connecting to a database with asp. That should give you enough to get started. Once you have some code written, come back and we can help you troubleshoot it.
__________________
--Dave--

U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM=

Reply With Quote
  #5  
Old October 1st, 2003, 02:59 PM
kbrooks kbrooks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 kbrooks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, you're going to think I'm a complete idiot....but what program do I even use for this? I've created everything in Front Page and I know there's a tab at the bottom for HTML view, but I don't see anything for asp.


Reply With Quote
  #6  
Old October 1st, 2003, 03:59 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
You can write asp code in the html view of Frontpage, just be sure to save the files with the .asp extension. Also, if you haven't used asp on your server before, be sure that it is installed on the server.

Reply With Quote
  #7  
Old October 9th, 2003, 10:27 AM
kbrooks kbrooks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 kbrooks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I did some searching and I think I found the asp code that I need to add. See if this looks right:

<%
Set Mail=Server.CreateObject("CDONTS.NewMail")
Mail.to="me@myaddress.com"
Mail.From="root@myaddress.com"
Mail.Subject="New Workorder"
Mail.Body="A new workorder has been submitted."
Mail.Send
Set Mail=nothing
%>


Now my problem is I have NO idea where to put it in with all the html code. The data is currently sent to a database using the Form Properties in Front Page, and I see it in the html way up at the top of the <form section.

Here is the part of html where my submit button is. I may have included too much because I'm not sure where one thing ends and another begins:

<p align="center">&nbsp;</p>
<p align="center"><input type="submit" value="Submit Workorder" name="B1">&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Clear All Fields" name="B2"></p>
</form>


Is this enough information? I can post the entire form section of code if I need to.

Reply With Quote
  #8  
Old October 9th, 2003, 11:42 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
You can add that code anywhere on the page. ASP is processed first on the server, before any of the html, so it doesn't matter where you put it.
For future ease of use, though, you might want to take my earlier suggestion and make a form handler page with your asp code in it, rather than putting it all in one page.

Reply With Quote
  #9  
Old October 9th, 2003, 11:44 AM
kbrooks kbrooks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 8 kbrooks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'll have to look into that! I tried doing a search on form handler and wasn't really clear on it, so it'll have to be a future thing. Thanks very much for all your help!

Reply With Quote
  #10  
Old October 9th, 2003, 11:57 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 13 m 21 sec
Reputation Power: 76
No problem. I'll try to explain the form handler thing again here, in case you get around to it.
When you made your form, in the first <form> tag, you have the "action" attribute (among others). To do what I suggested, if you had a form named "Fred", you would create a new asp page named "fredhandler.asp" or something. Then, in your "Fred" form, you would make the "action" attribute "action=fredhandler.asp" (assuming they are in the same directory. Then you just make a regular submit button.
In your "fredhandler.asp" page, you would put all your asp code, telling what to do with the data from the form, which you can use directly with "request.form("formfieldname")" or put into variables (recommended) and use that way.
The handler is preferable because it makes both pages easier to read, and makes it trivial to add more things to do with your form data.
Good luck with your project.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > From Front Page form, send to database AND email


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT