flnMichael
Programmer
Here's my issue: I have a page that loads up with a variable number of <select multiple> tags. Each select is a different database call to load up into the select. My issue is I need the selected values to go to the next page. The problem is I don't know the names of the options until I load the page and passing them to the validate has become a task for me. How do I get the values when I validate? The way I see it is I need something like this:
document.form.select.option.selected
right?
The names of the options are a combination of database name and unique identifier I need in the next page.
Here's my code
the 'OPTION' areas in the function are where I get a little confused as to what I need to get the names of the option tag from the html area. Can somebody help me? I know it may sound a little confusing, but I've had success here with more confusing questions than this so I thought I'd try.
Thanks
Mike
document.form.select.option.selected
right?
The names of the options are a combination of database name and unique identifier I need in the next page.
Here's my code
Code:
While Not osRecordSet.EOF 'database list
Response.Write("<select name=partnums_" & counter & " multiple size=6 width=25>")
While Not SteposRecordSet.EOF 'individual database connection
Response.Write("<option value='")
Response.Write(osRecordSet.Fields("database_name") & "_" & SteposRecordset("testdescid"))
SteposRecordSet.MoveNext
wend
SteposRecordSet.Close
osRecordSet.MoveNext
Wend
<td align=center><input type=button name=Submit value=Sumbit onclick='checkvalues(this.form, <%=testdesccount%>);'>
function checkvalues(form, counter)
{
var temp;
var i = 0;
while (i <= 2)
{
if (form["partnums_"+i].OPTION.selected)
{
array[i] = OPTION.value;
}
i = i + 1;
}
form.redo_list.value = 1;
form.submit();
}
the 'OPTION' areas in the function are where I get a little confused as to what I need to get the names of the option tag from the html area. Can somebody help me? I know it may sound a little confusing, but I've had success here with more confusing questions than this so I thought I'd try.
Thanks
Mike