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!

Problem code i can't see whats gone wrong (simple form) 1

Status
Not open for further replies.

hemal666

Programmer
Dec 10, 2001
25
GB
hey there peeps, ive been writing a form for a client, when the pgae loads none of the html shows, yet i can view source and its all there. Im sure its an obious mistake, but im blind to them. Please help, heres the code:
Code:
<%@ Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer = True %>
<?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>[/URL]
<html xmlns=&quot;[URL unfurl="true"]http://www.w3.org/1999/xhtml&quot;>[/URL]
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; />
<style type=&quot;text/css&quot;>
<!--
@import url(&quot;pcaid.css&quot;);
-->
</style>
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
// Validate the problem type  
function validproblemwith (problemwith)   {
	if (problemwith ==&quot;Make a Selection&quot;) {
	return false 
	}
return  true
}

// Validate the problem explaination  
function validprobexp (probexp)   {
	if (probexp ==&quot;&quot;) {
	return false 
	}
return  true
}

// Validate OS if choice made
function validOschoice (os) {
	if (os ==&quot;Other&quot;) && (oso ==&quot;&quot;) {
	return false
	}
return true
}

//Execute the valitation function
function submitform(check) {
	if(!validproblemwith(check.problemwith.value)) {
	alert(&quot;You Have Not Selected a Problem Type&quot;)
	check.problemwith.focus()
	check.problemwith.select()
	return false
	}
	
	if(!validprobexp(check.probexp.value)) {
	alert(&quot;You Have Not Explained Your Problem&quot;)
	check.probexp.focus()
	check.probexp.select()
	return false
	}
	if(!validos(check.os.value)) {
	alert(&quot;You Have Not Entered a Valid Operating System&quot;)
	check.os.focus()
	check.os.select()
	return false
	}
return true
}
</scrpit>
</head>

<body background=&quot;images/bk.gif&quot;>
<% 'declare variables
	dim custnme , custadd1 , custadd2
	dim custpc , custtel , custemail
	
	'Obtain information from form and remove apostopies (replaced with doubles)
	custnme=Replace(Request.Form(&quot;custnme&quot;),&quot;'&quot;,&quot;''&quot;)
	custadd1=Replace(Request.Form(&quot;custadd1&quot;),&quot;'&quot;,&quot;''&quot;)
	custadd2=Replace(Request.Form(&quot;custadd2&quot;),&quot;'&quot;,&quot;''&quot;)
	custpc=Replace(Request.Form(&quot;custpc&quot;),&quot;'&quot;,&quot;''&quot;)
	custtel=Replace(Request.Form(&quot;custtel&quot;),&quot;'&quot;,&quot;''&quot;)
	custemail=Replace(Request.Form(&quot;custemail&quot;),&quot;'&quot;,&quot;''&quot;)
%>
<table border=&quot;0&quot;>
	<tr>
		<td height=&quot;10&quot; width=&quot;10&quot;></td>
		<td height=&quot;10&quot; width=&quot;660&quot;><center><img src=&quot;images/PCAID-Logo(PC)Ver82.gif&quot; height=&quot;10&quot;/></center></td>
		<td height=&quot;10&quot; width=&quot;40&quot;></td>
	</tr>
	<tr>
		<td height=&quot;480&quot; width=&quot;10&quot;></td>
		<td width=&quot;660&quot; height=&quot;480&quot; class=&quot;pcaid&quot;>
			<h1 align=&quot;center&quot;>Contact Form - Part Two - Your Problem</h1>
			<form onSubmit=&quot;return submitform(this)&quot; method=&quot;post&quot; action=&quot;mail.asp&quot;>
				<input type=&quot;hidden&quot; name=&quot;custnme&quot; value=&quot;<%=custnme%>&quot;>
				<input type=&quot;hidden&quot; name=&quot;custadd1&quot; value=&quot;<%=custadd1%>&quot;>
				<input type=&quot;hidden&quot; name=&quot;custadd2&quot; value=&quot;<%=custadd1%>&quot;>
				<input type=&quot;hidden&quot; name=&quot;custpc&quot; value=&quot;<%=custpc%>&quot;>
				<input type=&quot;hidden&quot; name=&quot;custtel&quot; value=&quot;<%=custtel%>&quot;>
				<input type=&quot;hidden&quot; name=&quot;custemail&quot; value=&quot;<%=custemail%>&quot;>
				<table border=&quot;0&quot;>
					<tr>
						<td>Your Operating System</td>
						<td><select name=&quot;os&quot;>
								<option selected>Make a Selection</option>
								<option>Windows 95</option>
								<option>Windows 98</option>
								<option>Windows ME</option>
								<option>Windows XP</option>
								<option>Windows NT</option>
								<option>Windows 2000</option>
								<option>Windows 2000 Server</option>
								<option>Other</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>If Other OS Please Specify</td>
						<td><input type=&quot;text&quot; name=&quot;oso&quot;></td>
					</tr>
					<tr>
						<td>I am Having Problems With</td>
						<td><select name=&quot;problemwith&quot;>
								<option selected>Make a Selection</option>
								<option>Hardware Repairs</option>
								<option>Upgrades</option>
								<option>Backups</option>
								<option>Tutorials on Programmes</option>
								<option>Settings and Configurations</option>
								<option>Networks</option>
								<option>Sales Advice</option>
								<option>Other</option>
							</select><font color=&quot;#FF0000&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>*</font>
						</td>
					</tr>
					<tr>
						<td>Please explain your problem</td>
						<td><textarea rows=&quot;5&quot; cols=&quot;50&quot; name=&quot;probexp&quot;>Describe your problem here.</textarea><font color=&quot;#FF0000&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>*</font></td>
					</tr>
					<tr>
						<td>Comments</td>
						<td><textarea rows=&quot;2&quot; cols=&quot;50&quot; name=&quot;comments&quot;></textarea></td>
					</tr>
				</table>		
				<input type=&quot;submit&quot; value=&quot;Send to PC Aid Ltd&quot;>
				<font color=&quot;#FF0000&quot; size=&quot;-6&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>Fields with an marked with an asterisk (*) are compulsary</font>
		  </form>
		</td>
		<td height=&quot;480&quot; width=&quot;40&quot;></td>
	</tr>
	<tr>
		<td height=&quot;10&quot; width=&quot;10&quot;></td>
		<td height=&quot;10&quot; width=&quot;660&quot;><center><img src=&quot;images/PCAID-Logo(PC)Ver82.gif&quot; height=&quot;10&quot;/></center></td>
		<td width=&quot;40&quot; height=&quot;40&quot;></td>
	</tr>
</table>
</body>
</html>

Thanks in advance
hemal
 
fist of all:
1. check if the file has the extension .asp
2. check if u r running this from ur server and not using the local path.
3. check if ur server is really running.

Known is handfull, Unknown is worldfull
 
u have used:
<% Response.Buffer = True %>

try removing this and run the code...

Known is handfull, Unknown is worldfull
 
Ahem!

return true
}
</scrpit>
</head>



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Thanks chris new it would be something stupid like that :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top