I am trying to update some text fields in a form based on the selection of a drop down. I have figured out how to use asp scripting to access the database to look up the associated fields, but am having trouble figuring out how to grab the value from the drop down field and then use it when I look up the other data in my table. All of this needs to operate within a single page. Here is the code that I am using:
<script Language="VBScript">
function UpdtData()
//This is where I am trying to grab the selected value,
//which works, but I can't pass it into the next section
//of asp script.
t_id = document.JobFrame.Job.value
<%
jobs.MoveFirst
t_found = False
do while (Not(jobs.EOF) and Not(t_found))
'Value for t_id is null here
if (jobs.Fields(4) = t_id) then
t_client = jobs.Fields(3)
t_status = jobs.Fields(2)
t_title = jobs.Fields(5)
t_found = True
end if
jobs.MoveNext
Loop
%>
document.JobFrame.ClientName.value = "<%=t_client%>"
document.JobFrame.Status.value = "<%=t_status%>"
document.JobFrame.Title.value = "<%=t_title%>"
document.JobFrame.submit
end function
</script>
Please let me know what I am missing!
Thanks,
Janet
<script Language="VBScript">
function UpdtData()
//This is where I am trying to grab the selected value,
//which works, but I can't pass it into the next section
//of asp script.
t_id = document.JobFrame.Job.value
<%
jobs.MoveFirst
t_found = False
do while (Not(jobs.EOF) and Not(t_found))
'Value for t_id is null here
if (jobs.Fields(4) = t_id) then
t_client = jobs.Fields(3)
t_status = jobs.Fields(2)
t_title = jobs.Fields(5)
t_found = True
end if
jobs.MoveNext
Loop
%>
document.JobFrame.ClientName.value = "<%=t_client%>"
document.JobFrame.Status.value = "<%=t_status%>"
document.JobFrame.Title.value = "<%=t_title%>"
document.JobFrame.submit
end function
</script>
Please let me know what I am missing!
Thanks,
Janet