Help - Search - Members - Calendar
Full Version: Simple Button
HTMLHelp Forums > Programming > Server-side Scripting
Kendall
I'm trying to make my button go to Task2-Step2.asp. What am I missing?

[code]
<html>
<head>
<title>Assignment Twelve</title>
<link rel=stylesheet type='text/css' href='MyStyle.css'>
</head>

<!--#include file="MyInfo.asp" -->

<body>
<h2>Kendall's Task 2</h2>
<%


' Open connection to back-end SQL Server database
Set conn=Server.CreateObject("ADODB.Connection")
conn.CommandTimeout=15
conn.ConnectionTimeout=15
conn.Open BackEnd

' Begin input form
Response.Write("<form action='Task2-Step2.asp' method='post'>")


' Open recordset
sql="SELECT Distinct College FROM tblDiscipline INNER JOIN tblStudent ON tblDiscipline.DID=tblStudent.Major ORDER BY College"

Set rst=Server.CreateObject("ADODB.Recordset")
rst.Open sql, conn

' Display colleges
Response.Write("<h3>College</h3>")

Response.Write("<select name='College' style='width:150px'>")
Response.Write("<option value='College' selected></option>")
Do Until rst.EOF
Response.Write("<option value='" & rst("College") & "'>" & rst("College") & "</option>")
rst.MoveNext
Loop
Response.Write("</select>")


' Display button
Response.Write("<br><br>")
Response.Write("<input type='submit' value='Students'")


' End input form
Response.Write("</form>")


' Close recordset
rst.Close
Set rst=Nothing

' Close database connection
conn.Close
Set conn=Nothing
%>
</body>
</html>
Christian J
What does the rendered HTML look like when you run the ASP script on the server?
pandy
What happens when they hit the submit button?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.