Hello,
I have a page with a drop down that allows users to select a job and then they will get redirected to the apropriete page from this selection.
my siiue is with collecting the data from the drop down and making it a variable.
I can do this of I use a form and send them to a processing page but I am try to do this on the same page.
What I have so far is the drop down getting populated by a Database that gives the values. Now I need to pass the value selected to a redirect page (Session Variable) as I will use it in a SQL statement.
Thanks for looking!
I have a page with a drop down that allows users to select a job and then they will get redirected to the apropriete page from this selection.
my siiue is with collecting the data from the drop down and making it a variable.
I can do this of I use a form and send them to a processing page but I am try to do this on the same page.
What I have so far is the drop down getting populated by a Database that gives the values. Now I need to pass the value selected to a redirect page (Session Variable) as I will use it in a SQL statement.
Thanks for looking!
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<%@language = JScript%>
<!--#include file="adojavas.inc"-->
<html>
<head>
<title> </title>
<link href="job.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style3 {
font-family:Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: bold;
color: #006666;
}
-->
</style>
<%
Session("S_user")
Session("S_pass")
Session("S_jobname")
// this code checks that a valid user is logged in.
var jobName = Session("S_jobname")
//if(!Session("S_user")){
//Response.Redirect("../../login.html");
//}
//else{
//}
var connect = Server.CreateObject("ADODB.Connection");
var recordSet = Server.CreateObject("ADODB.RecordSet");
connect.Open("DSN=btvDB");
recordSet.Open("select DISTINCT jobCode from JobsiteLog",connect,adOpenKeyset,adLockOptimistic);
%>
<script type="text/javascript">
function reDirect(){
zoo = form.jobsite.value;
alert(zoo);
}
</script>
</head>
<body>
<div class="Wrapper">
<!-- Main Banner -->
<div id="HeadBanner">
<img src="../Images/headBanner.png" width="964" height="128" alt="">
</div>
<!-- END Main Banner -->
<!-- Begin of Navigation Div Bar -->
<div class="style3" id="NavBar">
<center>
HOME ADD LOG
</center>
</div>
<!-- End Nav bar -->
<div class="addJobLog">
<center>
<form onSubmit="reDirect(this)" action="" method="post" name="">
//************************************ THIS IS WHERE I NEED HELP!!!!*****************************************
<select name="jobsite">
<option value="PLEASE SELECT A JOB">PLEASE SELECT A JOB</option>
<%
while(!recordSet.EOF)
{
code = recordSet("jobCode")
Response.Write("<option name='" + code + "'>");
Response.Write(code);
Response.Write("</option>");
recordSet.MoveNext();
}
%>
</select>
<input type="button" value="Submit" onClick="reDirect()">
</form>
</center>
</div>
</div>
</body>
</html>
[code]