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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

405 error calling an asp page 1

Status
Not open for further replies.

Ju1c3

MIS
Apr 3, 2007
43
US
ok, ive tried 2 forms now, and one works and the other doesnt. the difference is one is a nested table in the form(doesnt work) and the other is a plain old form(works). ive tried removing all the nested table junk from it and it still doesnt work and i cant seem to figure out why it isnt working. could someone please take a look at this and let me know whats wrong, or point me in the right direction. ive been trying to get this going for like 3 hours now and done my google homework and i cant find anything.

working one:
Code:
<form method="post" action="/cgi-bin/SendMail.asp">
   Complete this form and click the submit-button. We will answer your
   questions as soon as possible.
   <br><br>
   Your Name: <br>
   <input type="text" size="25" name="name"><br>   
   Your Email:<br>
   <input type="text" size="25" name="email"><br>
   Your Address:<br>
   <input type="text" size="25" name="address"><br>
   Enter your comment: <br>
   <textarea name="body" cols="40" rows="15"   Wrap="PHYSICAL"></textarea>
   <br>
   <input type="submit" value=" Submit ">
</form>

not working one:
Code:
			<form method="post" action="/cgi-bin/SendMail.asp">
				<table cellpadding="4" cellspacing="0" border="0" align="center" class="contactForm">			
					<tr>
						<td>Legal Company Name:</td>
						<td><input type="text" name="txtLegCompanyName" /></td>
					</tr>
					<tr>
						<td>DBA Name:</td>
						<td><input type="text" name="txtDBAName" /></td>
					</tr>
					<tr>
						<td>Contact Name:</td>
						<td><input type="text" name="txtcontactname" /></td>
					</tr>
						<td>Address 1:</td>
						<td><input type="text" name="txtAddress1" /></td>
					</tr>
					<tr>
						<td>Address 2:</td>
						<td><input type="text" name="txtAddress2" /></td>
					</tr>
					<tr>
						<td>Phone/Fax:</td>
						<td><input type="text" name="txtfaxphone" /></td>
					</tr>
					<tr>
						<td>Type of Corporation (S-corp, C-corp, LLC, etc.):</td>
						<td><input type="text" name="txtcorptype" /></td>
					</tr>
					<tr>
						<td>Number of Locations:</td>
						<td><input type="text" name="txtnumlocations" /></td>
					</tr>
					<tr>
						<td>Number of Employees:</td>
						<td><input type="text" name="txtnumemployees" /></td>
					</tr>
					<tr>
						<td>Do you currently have a retirement plan?</td>
						<td><input type="text" name="txtretirementplan" /></td>
					</tr>
					<tr>
					<td>----</td>
					</tr>
					<tr>
						<td>If yes:</td>

					</tr>
						<td>Total Assets:</td>
						<td><input type="text" name="txtassest" /></td>
					</tr>
					<tr>
						<td>Annual Deposits:</td>
						<td><input type="text" name="txtdeposits" /></td>
					</tr>
					<tr>
						<td>Number of Participants:</td>
						<td><input type="text" name="txtparticipants" /></td>
					</tr>
					<tr>
						<td>Current Vendor:</td>
						<td><input type="text" name="txtvendor" /></td>
					</tr>
					<tr>
					<td>----</td>
					</tr>
					<tr>
						<td>If No:</td>
					</tr>
						<td>Will there be a company match?</td>
						<td><input type="text" name="txtcompanymatch" /></td>
					</tr>
					<tr>
						<td>Heartland Rep Nme:</td>
						<td><input type="text" name="txtrepname" /></td>
					</tr>
					<tr>
						<td>Rep Phone/Fax:</td>
						<td><input type="text" name="txtrepphonefax" /></td>
					</tr>
					<tr>
						<td>Rep Email:</td>
						<td><input type="text" name="txtrepemail" /></td>
					</tr>
				 </table>
				<input type="submit" value="Submit"/>
			</form>
 
by the way, its throwing a 405 error... should have posted that before.

HTTP Error 405 - The HTTP verb used to access this page is not allowed.
Internet Information Services (IIS)

Ju1c3: MCP Vista
 
Maybe the problem has nothing to do with the HTML form.

Both forms submit to the same ASP page but the first one has elements named name, email, and address and the second one has none of these elements... having instead things like txtDBAName and so on...

So is it possible that the script in SendMail.asp is expecting the elements in the first form but not in the second form?

Other possibilities exist.
 
i changed sendmail to want the new values... i am adapting the new code form some old code i had laying around.

Ju1c3: MCP Vista
 
The non working one looks like it is being developed as XHTML. Does the page validate? There may be something going on there- change your DTD and see if it works.
 
ive never seen xhtml so i got no clue about that. could you shed some light on DTD?


i keep inserting this in the same page. remove one and put the other in in the same spot. the one works, the other doesnt. thats why i thought it had nothing to do with the rest of the page.

and the one that works, it will send an email and everything so i have no clue.

Ju1c3: MCP Vista
 
Changing the markup shouldnt have any impact on the server.

I would agree with that if the error was in the browser but 405 is an HTTP error... so I think the problem is likely inside the ASP... so could you post it?
 
i think i solved it guys....

the entire body of the html page was a form. i just had to get this code outside of the body form. why one worked and the other didnt i have no freaking clue. more then likely something to do with the tables and forms being stacked inside each other. messed up i know. so i guess for future reference, you cant have:

form
table
form
table
/table
/form
/table
/form



Ju1c3: MCP Vista
 
But the code posted above doesnt have nested forms.
 
but the rest of the page did.....

Ju1c3: MCP Vista
 
meaning the body was a giant form( i am editing someone else's code. i never get to write my own from scratch, i always have to fix someones else's stuff when a client wants a page edited.)i didnt notice that untill right there at the end. so i am guessing the submit button i was trying to use was reacting to the "body" for rather then the form i was trying to submit.... but i dont get how it worked with the one code and not the other. as i said, it must have had something to do with the tables.

moved the close tag for the "body form" to tight in front of the not working form and everything went kosher.

Ju1c3: MCP Vista
 
meaning the body was a giant form( i am editing someone else's code. i never get to write my own from scratch, i always have to fix someones else's stuff when a client wants a page edited.)i didnt notice that untill right there at the end. so i am guessing the submit button i was trying to use was reacting to the "body" for rather then the form i was trying to submit.... but i dont get how it worked with the one code and not the other. as i said, it must have had something to do with the tables.
Which is why I wanted you to validate and check your page structure.

Here is a validator:

Although not ASP related, it can help find incorrectly formed pages that are messing things up.
 
wow that thing is awesome. i didnt know it existed. thank you very much as it will help me in the future. the thing i never liked about web programming is the lack of error checking.

thank you so much again.

Ju1c3: MCP Vista
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top