Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Form validation question
Old 04-25-2006, 07:26 PM Form validation question
Average Talker

Posts: 26
Trades: 0
Hi guys,
I have a form that user fills can it up and in the form just name and email are mandetory, so when resume doesn't get attached, I get this error how can I stop getting this? I don't have this problem with the others fields.

Thanks a lot for your help,
Elham
------------Erroe-------------

Microsoft VBScript runtime error '800a01a8'

Object required: '[object]' /contact/UploadScript11.asp, line 131
-----------Code--------------
<%
Set Upload = Server.CreateObject("Persits.Upload")
Count = Upload.Save("C:\Inetpub\wwwroot\stecs-dev\contact\")
Response.Write Count & " file(s) uploaded to C:\Inetpub\wwwroot\stecs-dev\contact\"
Response.write("<hr>")
%>
<%
SUB sendmail( fromWho, toWho, AddAttachment1, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "stecs-exchange.stecs.com"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.AddAttachment AddAttachment1
objCDO.TextBody = "CONTACT INFORMATION" & vbCrLf & "____________________" & vbCrLf &_
"Name: " & firstname & vbCrLf & "Company: " &company & vbCrLf &_
"Address: " & Address & vbCrLf & "City: " &city & ", "& state & " " &zip & vbCrLf &_
"Country: " &country & vbCrLf & "phone: " &phone & vbCrLf & "My Message : " & myMessage & vbCrLf & "How did you hear about us? " & Body
objCDO.Send
ConfirmMsg = Response.redirect("thankyou.html")
END SUB
Dim Domainname
Dim MailServer
Dim From
Dim subject1
Domainname = "webdev.stecs.com"
MailServer = Upload.Form("MailServer")
subject1 = "IDS-7934969 - "
fromWho = Upload.Form( "fromWho")
'toWho = Upload.Form( "toWho") + "@stecs.com"
toWho = "resumes@stecs.com"
AddAttachment1= Upload.Files("toAttachment").path
firstname = TRIM( Upload.Form( "Name" ) )
company = TRIM( Upload.Form( "Company" ) )
address = TRIM( Upload.Form( "Address" ) )
city = TRIM( Upload.Form( "City" ) )
state = TRIM( Upload.Form( "State" ) )
zip = TRIM( Upload.Form( "Zip" ) )
country = TRIM( Upload.Form( "Country" ) )
phone = TRIM( Upload.Form( "Phone" ) )
myMessage = TRIM( Upload.Form( "MyMessage" ) )
Subject = TRIM( Upload.Form( "Subject" ) )
Body = TRIM( Upload.Form( "Body") )
send_mail = Upload.Form( "send_mail")
If send_mail <> "" THEN
sendMail fromWho, toWho, AddAttachment1, Subject, Body

'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
END IF
%>
elham is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-25-2006, 07:49 PM Re: Form validation question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
assuming line 131 is this

AddAttachment1= Upload.Files("toAttachment").path

check that the object "upload" exists first
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-25-2006, 08:07 PM Re: Form validation question
Average Talker

Posts: 26
Trades: 0
Thank you so much for the response.

Yes ASPUpload is there and I don't have any problem if I attach the file; so it shows it works fine and I just have problem when I don't want to attach a file and submit the form.
elham is offline
Reply With Quote
View Public Profile
 
Old 04-25-2006, 08:36 PM Re: Form validation question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
simply check that a file has been uploaded (or not), if not don't try and attach one.


I don't use aspupload so have no idea what to test. But I would assume that count would be 0
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-25-2006, 08:47 PM Re: Form validation question
Average Talker

Posts: 26
Trades: 0
Many thanks.
Elham
elham is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Form validation question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15307 seconds with 12 queries