Current location: Hot Scripts Forums » Programming Languages » ASP » Mail Form ASP is not requiring submitted fields/forms


Mail Form ASP is not requiring submitted fields/forms

Reply
  #1 (permalink)  
Old 03-01-09, 07:02 PM
mansour mansour is offline
Newbie Coder
 
Join Date: Oct 2004
Location: va, us
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Mail Form ASP is not requiring submitted fields/forms

I made an ASP mail script with my limited knowledge of the ASP language. The email sends out fine, but the fields that are filled out are left blank in the email.

For example:

"Day Phone: --" vs. "Day Phone: 555-555-5555"

Here is the script:

PHP Code:

<&#37;
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Foreclosure Submission"
myMail.From="firstemail@gmail.com"
myMail.Cc="secondemail@gmail.com"
myMail.To="firstemail@gmail.com"
emailBody "Day Phone: " Response.Write(request.form("Field6")) & "-" Response.Write(request.form("Field6-1")) & "-" Response.Write(request.form("Field6-2")) & "<br>"
myMail.HTMLBody emailBody
myMail
.Send
set myMail
=nothing
%> 
Again I'm not completely familiar with ASP. The Submission form has the Method posted as "POST" and the Action directed to "../form2.asp" (also tried full http)

Server: Windows Hosting Shared.

name of submission form: form.asp
name of processing script: form2.asp
Reply With Quote
  #2 (permalink)  
Old 03-01-09, 07:53 PM
Dwagar's Avatar
Dwagar Dwagar is offline
Newbie Coder
 
Join Date: Sep 2008
Location: Ohio
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Just remove the response.write for the requests and should fix the issue for you. For an example

Response.Write(request.form("Field6"))

Should be

request.form("Field6")
__________________
SepCity Portal Solutions
Reply With Quote
  #3 (permalink)  
Old 03-01-09, 09:08 PM
mansour mansour is offline
Newbie Coder
 
Join Date: Oct 2004
Location: va, us
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dwagar View Post
Just remove the response.write for the requests and should fix the issue for you. For an example

Response.Write(request.form("Field6"))

Should be

request.form("Field6")
Yah I tried that to, results are still the same.


"Day Phone: --"

PHP Code:

<%

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Foreclosure Submission"
myMail.From="firstemail@gmail.com"
myMail.Cc="secondemail@gmail.com"
myMail.To="msuliman@gmail.com"
emailBody "Day Phone: " request.form("Field6") & "-" request.form("Field6-1") & "-" request.form("Field6-2") & "<br>"
myMail.HTMLBody emailBody
myMail
.Send
set myMail
=nothing
%> 
Another question does this script have to be inside the same directory as the submission form? for ex:

../section/submission_form.asp
../section/process_form.asp

instead of

../section/submission_form.asp
../process_form.asp

Thanks and all help is appreciated
Reply With Quote
  #4 (permalink)  
Old 03-01-09, 11:26 PM
Dwagar's Avatar
Dwagar Dwagar is offline
Newbie Coder
 
Join Date: Sep 2008
Location: Ohio
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
That code looks like it should work, make sure the field names on the form are spelled the same as the request.form items that you are doing. The directory structure does not matter.
__________________
SepCity Portal Solutions
Reply With Quote
  #5 (permalink)  
Old 03-02-09, 03:20 AM
mansour mansour is offline
Newbie Coder
 
Join Date: Oct 2004
Location: va, us
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Thank You Dwagar, I have found the problem and I would like to share the solution just in case anyone runs into the same problem.

The problem was the HTML Form Code:

I think it was most likely the Enctype method used below that was interfering with it I took it off look at the before and after.

Before:

PHP Code:

<form id="register" name="form7" class="formLabels" autocomplete="off"

    
enctype="multipart/form-data" method="post" action="../form2.asp"
After:

PHP Code:

<form id="register" name="form7" class="formLabels" method="post" action="../form2.asp"
Now it works without any problems

Thank You
Reply With Quote
  #6 (permalink)  
Old 03-02-09, 03:51 PM
Dwagar's Avatar
Dwagar Dwagar is offline
Newbie Coder
 
Join Date: Sep 2008
Location: Ohio
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Your welcome, that would do it, the enctype="multipart/form-data" is usually used for uploading files, at lease thats the only thing I have ever used it for and the request thing would have to be different. Beleive upload.form is ASP but can be mistaken.
__________________
SepCity Portal Solutions
Reply With Quote
  #7 (permalink)  
Old 03-02-09, 06:35 PM
mansour mansour is offline
Newbie Coder
 
Join Date: Oct 2004
Location: va, us
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
I will keep that in mind for the future when I'm building a form that requires file uploading.

Thank you again Dwagar.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP or PHP which is better? nepala The Lounge 9 07-14-10 05:48 AM
ajax checking and onsubmit issue follower JavaScript 4 10-12-08 03:45 PM
ASP - form to form submit (cookies?) deltatango5 ASP 2 09-29-08 06:17 AM
Attachement help needed sujata_ghosh Perl 18 06-22-07 01:00 PM
ASP Form Mail tferrentino ASP 2 02-25-05 10:22 AM


All times are GMT -5. The time now is 04:05 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.