First of all really new at this found Scriptalicious and have starting
using it primarily for the autocompleter .. I have started doing some
other work in a form client side that will fill in a multiple select
box depending on what is chosen from another multiple select box code
as follows
<script language="JavaScript" type="text/javascript">
function populate()
{
var txtSelectedValuesObj
document.getElementById(''txtSelectedValues'');
var selectedArray = new Array();
var selObj = document.getElementById("D2");
var i;
var count = 0;
for (i=0; i<selObj.options.length; i++) {
if (selObj.options[i].selected) {
selectedArray[count] = selObj.options[i].value;
count++;
}
}
rows = <% =intRows %>;
suburbArray = new Array();
<%
strbsRS = "SELECT * " & _
"FROM tbl_suburbs"
set bsRS = Server.CreateObject("ADODB.recordset")
set bsRS = bsConn.Execute (strbsRS)
do while not bsRS.eof
%>
suburbArray[<% =bsRS("id") %>] = ''<%
=bsRS("districtid") %>, <%
=bsRS("id") %>, <% =bsRS("suburb") %>''
<%
bsRS.movenext
Loop
bsRS.close
%>
i = 0;
for (x in suburbArray)
{
splitstring = suburbArray[x].split(", ")
for (y in selectedArray)
{
if(selectedArray[y] == splitstring[0])
{
document.frm_master.D3.options[i] = new Option(splitstring[2],
splitstring[1], false, true);
i = i + 1;
}
if (i == 0)
{
document.frm_master.D3.options.length=0;
}
}
}
}
</script>
It works perfectly ok without calling the prototype.js script but fails
to run correctly at least in ie with the following error ''Object
doesn''t support this property or method'' Being new to this I
am not
sure how or what is causing it
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---