Hi
I want to write code in Javascript which pulls out entries from a database
via a for loop. Essentially what I am trying to do is something like:
//setting up database connection
<%
Set cnn = ...
filePath = ...
cnn.Open ....
Set rst = ...
sqlquery = "SELECT ....."
rst.open sqlquery, cnn, 2, 2
%>
//Javascript code
<SCRIPT LANGUAGE = "JavaScript">
<!--
.....
function test()
{
document.Insurance.county.length = 10;
for (var x = 1; x <= 10; x++)
{
document.Insurance.county[x].value = rst("County_ID");
document.Insurance.county[x].text = rst("County");
rst.next();
}
}
.....
--!>
Is something like this possible or am I doing something incorrect here? This
is part of a code for a form where "County" is a dropdown. So instead of
hardcoding the values for "County_ID" and "County", I want to write a for
loop which loads the values to be displayed in the dropdown from the
database. Any help/hints/suggestions would be highly appreciated...
Navodit