[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 925
  • Last Modified:

My dropdown isn't working in firefox...

My dropdown code DOES work in firefox...I got it off the boards here and BY itself it works GREAT...
but if I put it within MY drop down it doesn't work...just flickers...
HERE is the original code...IT ROCKS...<html>
<head>
<script type="text/javascript">
<!--
function selChk(obj) {
      if(obj.value!='nosel') {
            var rs = document.getElementsByName('rad');
            for(i=0; i<rs.length; i++){
                  rs[i].disabled = false;
            }
            if(rs.length>0) rs[0].focus();
      } else {
            var rs = document.getElementsByName('rad');
            for(i=0; i<rs.length; i++){
                  rs[i].disabled = true;
                  rs[i].checked = false;
                  rs[i].blur();
            }
      }
}

function frmChk(){
      var rs = document.getElementsByName('rad');
      var chk = false;
      for(i=0; i<rs.length; i++){
            if(rs[i].checked) return true;
      }
     
      alert('You must select one of the choices!');
      return false;
}
//-->
</script>
</head>
<body>
<form onsubmit="return frmChk();">
The Select Box:
<select id="sel" onchange="selChk(this);">
      <option selected value="nosel">Select A Value
      <option value="val">Value
      <option value="val2">Value 2
</select>
<br><br>
The Radio Buttons:<br>
<input type="radio" name="rad" disabled> Choice 1&nbsp;&nbsp;<input type="radio" name="rad" disabled> Choice 2
<br><br>
The Submit Button: <input type="submit" value="Submit!">
</form>
</body>
</html>


****************************
THIS DOES NOT WORK
****************************

<select size="1"  name="assignOwner"  tabindex="2" id="sel" onchange="selChk(this);">
           
           
 <%
  ' this needs to be changed to allow for grouplead of 1
 
 if deptlead = 0 then
dim mRSa
dim mRS1a


set mRSa = server.createobject("ADODB.Recordset")
mRSa.Open "SELECT DISTINCT deptGroup from EmpDB where active='1' and support='1' and (Business = 'Drake Software' or business = 'Dnet') order by deptGroup", Conn

set mRS1a = server.createobject("ADODB.Recordset")

response.write "<option value=none selected  tabindex=3 >Select associate to assign this call to:</option>"
do while not mRSa.EOF
   response.write "<option value="& mRsa.fields("deptGroup") &"  tabindex=4 >------:" & mRsa.fields("deptGroup") & ":------</option>"
   mRS1a.Open "select * from EmpDB where deptGroup='" & mRsa.fields("deptGroup") & "' and (Business = 'Drake Software' or business = 'Dnet') and support ='1' and active ='1' Order By fname, lname", Conn
   do while not mRS1a.EOF%>
          <option value=<%= mRS1a("login")%>  tabindex="5" ><%= mRS1a("fName")%>&nbsp;<%= mRS1a("lName")%></option>
         <%'response.write "<option  tabindex="6" >" & mRS1a.fields("fname") & "</option>"
         mRS1a.Movenext
   loop
  mRS1a.Close
  mRSa.Movenext
loop
%>
</select>

<% set mRS1a = Nothing
mRSa.Close
set mRSa = Nothing

  ' this needs to be changed to allow for grouplead of 1
 
dim mRSa1

else

set mRSa1 = server.createobject("ADODB.Recordset")
mRSa1.Open "SELECT * from EmpDB where active='1' and support='1' and (Business = 'Drake Software' or business = 'Dnet') and deptgroup='" & DeptRSS & "'", Conn

response.write "<option value=none selected  tabindex=3 >Select associate to assign this call to:</option>"
do while not mRSa1.EOF
   response.write "<option value="& mRsa1.fields("login") &"  tabindex=4 >" & mRsa1.fields("fname") & "&nbsp;"& mRsa1.fields("lname") & "</option>"
 
  mRSa1.Movenext
loop
%>
</select>
<%

mRSa1.Close
set mRSa1 = Nothing
end if
%>
0
tsmithinnc
Asked:
tsmithinnc
  • 3
1 Solution
 
gops1Commented:
Not sure what is this piece of code trying to achieve:

else {
            var rs = document.getElementsByName('rad');
            for(i=0; i<rs.length; i++){
                  rs[i].disabled = true;
                  rs[i].checked = false;
                  rs[i].blur();
            }

0
 
gops1Commented:
Sorry for my previous comment. I misread the code
0
 
gops1Commented:
In your code do you have this check?

  if(obj.value!='nosel') {
.....
...
0
 
VincentPugliaCommented:
Hi,
Three questions:
1) Is the select embedded within a form?
2) What does FF's Error Console (Tools) say the problem is?
3) What does the 'rendered code" look like?  We don't really need tosee actual data (login info), but the html tags would help.  (IE & Asp tend to be somewhat lax in W3 standards)
0
 
James RodgersWeb Applications DeveloperCommented:
the element <option> does not have an attibute 'tabindex' the select object does
and i think your issue is related to your default
response.write "<option value=none selected  tabindex=3 >Select associate to assign this call to:</option>"

the code is looking for a default of 'nosel'
 if(obj.value!='nosel') {
you have it as none
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now