473,671 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp code working in firefox and ie7 but not working in ie6

2 New Member
i just write code for select option in combo box which i m select but when i press search button and then click on back button then there in no option selected. and that same code working in ie7 and firefox so plz any 1 suggest me soluction quickly..
Nov 28 '07 #1
3 1948
acoder
16,027 Recognized Expert Moderator MVP
Can you post your code please.
Nov 28 '07 #2
kepskp
2 New Member
Can you post your code please.
Expand|Select|Wrap|Line Numbers
  1. <%
  2. set dataConnection = Server.CreateObject("ADODB.Connection")
  3. dataConnection.Open MAIN_DSN
  4.  
  5. sqlQuery =  "EXEC sp_getCategories NULL"
  6. set categoriesRS = dataConnection.Execute(sqlQuery)
  7.  
  8. if (not(categoriesRS.BOF and categoriesRS.EOF)) then   
  9.    arrCategoriesDB = categoriesRS.GetRows()
  10.  
  11.    arrcount = 0
  12.    for each fieldValue in categoriesRS.fields
  13.       fieldName = fieldValue.Name
  14.       Execute("fld_" & fieldName & " = arrcount")
  15.       arrcount = arrcount + 1
  16.    next
  17.  
  18.    numCategoriesRows=ubound(arrCategoriesDB,2)
  19. end if
  20.  
  21. set categoriesRS = nothing
  22.  
  23. firstCat1 = ""
  24. if (thisCategoryID <> "") then
  25.    sqlQuery =  "EXEC sp_getCategories " & thisCategoryID
  26.    set pathRS = dataConnection.Execute(sqlQuery)
  27.  
  28.    index=0
  29.    for x=1 to 4
  30.       if (pathRS("CategoryID" & x) <> 0) then
  31.          index = index + 1
  32.          Execute("firstCat" & index & " = pathRS(""CategoryID" & x & """)")
  33.       end if
  34.    next
  35.  
  36.    set pathRS = nothing
  37. end if
  38.  
  39. ' Function to create the a list of code for dynamic drop down javascript
  40. function javaArray()
  41.  
  42.    prevCat = ""
  43.    for rowcounter = 0 to numCategoriesRows
  44.       if (arrCategoriesDB(fld_CategoryID3,rowcounter) <> prevCat) then
  45.          prevCat = arrCategoriesDB(fld_CategoryID3,rowcounter)
  46.          strQuery = strQuery & "arrCat[" & prevCat & "] = """
  47.  
  48.          for rowcounter2 = 0 to numCategoriesRows
  49.             if (arrCategoriesDB(fld_CategoryID3,rowcounter2) = prevCat) then
  50.                strQuery = strQuery & arrCategoriesDB(fld_CategoryName4,rowcounter2) & "#" & arrCategoriesDB(fld_CategoryID4,rowcounter2) & "||"
  51.             end if
  52.          next
  53.  
  54.          strQuery = strQuery & """;"
  55.       end if
  56.    next
  57.  
  58.    javaArray = strQuery 
  59. end function
  60.  
  61. %>
  62. <script language="javascript">   
  63.    var arrCat = new Array();
  64. <%= javaArray() %>
Expand|Select|Wrap|Line Numbers
  1. function mmChangeContact(objFldParent,objFldChild, contact_caption)
  2. {
  3.    var ContactList = arrCat[<%= firstCat1 %>];
  4.    clearList(objFldChild);
  5.    addElement(objFldChild, contact_caption, "");
  6.  
  7.    if(ContactList)
  8.    {
  9.  
  10.       var rgContacts = ContactList.split('||');
  11.  
  12.             addElement(objFldChild, "Select All", "ALL");
  13.       for (var i = 0; i < rgContacts.length; i++)
  14.       {
  15.          if (rgContacts[i])
  16.          {
  17.             var rgContact = rgContacts[i].split('#');
  18.                         addElement(objFldChild, rgContact[0], rgContact[1]);
  19.          }
  20.       }
  21.  
  22.       objFldChild.disabled = false;
  23.    } 
  24.      else 
  25.      {
  26.       objFldChild.disabled = true;
  27.    }
  28.  
  29.      //objFldChild.selectedIndex = 0;
  30.  
  31.  
  32. function clearList(list) 
  33. {
  34.    var i = 0;
  35.    var o = list.options;
  36.  
  37.    for (i = o.length; i >= 0; --i)
  38.       o[i] = null;
  39.    list.disabled = true;
  40. }
  41.  
  42. function addElement(list, text_in, value_in)
  43. {
  44.    var o = list.options;
  45.    var nIdx;
  46.  
  47.    if (o.length < 0) //IE for Mac 4.5 sets length to -1 if list is empty
  48.       nIdx = 0;
  49.    else
  50.  
  51.    nIdx = o.length;
  52.  
  53.    o[nIdx] = new Option(text_in, value_in);
  54.    list.disabled = false;
  55. }
  56.  
  57. function setDefaultByText(list, text_in)
  58. {
  59.    with (list)
  60.    {
  61.       for (var i = 0; i < (options.length); i++)
  62.       {
  63.          if (options[i].text == text_in)
  64.          {
  65.             selectedIndex = i;
  66.             return;
  67.          }
  68.        }
  69.    }
  70. }
  71.  
  72. function setDefaultByValue(list, value_in)
  73. {
  74.    with (list)
  75.    {
  76.       for (var i = 0; i < (options.length); i++)
  77.       {
  78.          if (options[i].value == value_in)
  79.          {
  80.             selectedIndex = i;
  81.             return;
  82.          }
  83.       }
  84.    }
  85. }
  86.  
  87. function validate(){
  88.    var objFld = document.EDITPRODUCT
  89.    var flagAffiliate = 0
  90.  
  91.     if (objFld.Parent1.value != "") 
  92.     {
  93.         objFld.CategoryID.value = objFld.Parent1.value
  94.         flagAffiliate = 1
  95.     }
  96.  
  97.     if (objFld.Parent1.value == "")
  98.     {
  99.         alert("Please Select a Make");
  100.         return false; 
  101.     }
  102.     /*if (objFld.Child.value == "")
  103.     {
  104.         alert("Please Choose a Vehicle Model");
  105.         return false; 
  106.     }
  107.     if (objFld.GrandChild.value == "")
  108.     {
  109.         alert("Please Choose a Vehicle Model");
  110.         return false; 
  111.     }*/
  112.  
  113.     return true;
  114. }
  115. </script>
Expand|Select|Wrap|Line Numbers
  1. <%
  2.         if (Cint(catID) = CARS) then
  3.             MakeImage = "/auto_classifieds_images/sh_make.gif"
  4.         elseif (Cint(catID) = TRUCKS) then
  5.             MakeImage = "/auto_classifieds_images/sh_make.gif"
  6.         elseif (Cint(catID) = MOTORCYCLES) then
  7.             MakeImage = "/auto_classifieds_images/sh_make.gif"
  8.         elseif (Cint(catID) = BOATS) then
  9.             MakeImage = "/auto_classifieds_images/sh_boat.gif"
  10.         elseif (Cint(catID) = RVS) then
  11.             MakeImage = "/auto_classifieds_images/sh_make.gif"
  12.         elseif (Cint(catID) = SPECIALTY) then
  13.             MakeImage = "/auto_classifieds_images/sh_specialty.gif"
  14.         end if
  15. %>
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="CategoryID" value="">
  2.    <tr> 
  3.       <td width="100" align="right"><img src="<%= MakeImage %>" width="90" height="28" border="0"></td>
  4.       <td width="200"><select name="Parent1">
  5.             <option value="">----------- Select One -----------</option>
  6.                 <option value="ALL">Select ALL</option>
  7.             <%
  8.    for rowcounter = 0 to numCategoriesRows
  9.       if (arrCategoriesDB(fld_CatParent4,rowcounter) = 0) then
  10.          selectThis = ""
  11.          if ( arrCategoriesDB(fld_CategoryID4,rowcounter) = firstCat1) then
  12.             selectThis = "selected"
  13.          end if
  14.  
  15.             if arrCategoriesDB(fld_CategoryID4,rowcounter) <> 0 then
  16. %>
  17.             <option value="<%= arrCategoriesDB(fld_CategoryID4,rowcounter) %>" <%=selectThis%>><%= arrCategoriesDB(fld_CategoryName4,rowcounter) %></option>
  18.             <%
  19.             end if
  20.       end if
  21.    next
  22. %>
  23.          </select></td>
  24.    </tr>
  25. <script language="javascript">
Expand|Select|Wrap|Line Numbers
  1. <%
  2. if (firstCat1 <> "") then
  3. %>    
  4.     mmChangeContact(document.EDITPRODUCT.Parent1,document.EDITPRODUCT.Parent1, '----------- Select One -----------');
  5.     setDefaultByValue(document.EDITPRODUCT.Parent1,'<%= firstCat1 %>')
  6. <%
  7. end if
  8.  
  9. if (firstCat2 <> "") then
  10. %>
  11. mmChangeContact(document.EDITPRODUCT.Parent1,document.EDITPRODUCT.Child, '----------- Select One -----------');
  12. setDefaultByValue(document.EDITPRODUCT.Child,'<%= firstCat2 %>')
  13. <%
  14. end if
  15.  
  16. if (firstCat3 <> "") then
  17. %>
  18. mmChangeContact(document.EDITPRODUCT.Child,document.EDITPRODUCT.GrandChild, '----------- Select One -----------');
  19. setDefaultByValue(document.EDITPRODUCT.GrandChild,'<%= firstCat3 %>')
  20. <%
  21. end if
  22.  
  23. if (firstCat4 <> "") then
  24. %>
  25. mmChangeContact(document.EDITPRODUCT.GrandChild,document.EDITPRODUCT.GreatGrandChild, '----------- Select One -----------');
  26. setDefaultByValue(document.EDITPRODUCT.GreatGrandChild,'<%= firstCat4 %>')
  27. <%
  28. end if
  29. %>
  30.  
  31. </script>
Nov 29 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Can you post the generated client-side source code instead (using code tags please).
Nov 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
4991
by: Gregory Piñero | last post by:
Hi guys, I'm trying to run this statement: os.system(r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + ' "www.blendedtechnologies.com"') The goal is to have firefox open to that website. When I type r'"C:\Program Files\Mozilla Firefox\firefox.exe"' + '
3
6987
by: The Bicycling Guitarist | last post by:
http://www.TheBicyclingGuitarist.net/css/index.css I have red nav buttons that turn blue when hovered over and turn purple after being visited. The red and blue work in FireFox, but not the visited color. How can I fix this? It's always worked in MSIE cough cough. It's for my index page http://www.TheBicyclingGuitarist.net/index.htm
6
14448
by: Mark Olbert | last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an autopostback checkbox, for that matter). I'm aware of a problem with Netscape browsers and the postback code, but I have a workaround for that installed (and it looks like the code generated by ASP.NET when it renders the page does the same thing, namely, setting document<). However, the problem still exists under firefox. Has anyone come...
7
9601
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script language="JavaScript"> var cntlName; var eleTarget = document.getElementById('hiding'); function showOrHide(){
1
3145
by: ajaysoniji | last post by:
Hi, I am using this code to read the option values from a select option. I am getting the reference of that select option in arg1. Its working fine with mozilla firefox but not with Internet Explorer. It gives the lenth but failing to read the arguments(Shown in bold). It gives the alert Internet Explorer 4 for IE and Netscape 5 for Mozilla firefox for the alert in line 4. Please Suggest as soon as possible how I can read the values of the...
9
5297
by: javakid | last post by:
Hi Following form validatioin code is working fine on IE but not working on Mozilla Firefox V2. Can any body suggest? Regards <script ="JAVASCRIPT" type="text/javascript"> //--------------- LOCALIZEABLE GLOBALS --------------- var d=new Date();
5
6589
by: CoolForU | last post by:
this is my code and i call this code from code behinde file on page load like this useragree.Attributes.Add("onclick", "CheckSelection();") this is working fine with IE but not working with fire fox. in firefox i got error : Error: CheckSelection is not defined
3
2005
by: rajasree | last post by:
Hi all, am doing a project in PHP. my javascript code is working properly in ie. But its not working in firefox. Please help me my code is as follows; <script language="javascript" type="text/javascript"> function call() { var box=new Array(50);
1
8022
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the flash window comes above the iframe area the html links stop working. Yet the links remain active when the flash window is outside the iFrame area. This problem is coming in Firefox, but running fine in IE. If anybody has any solution, please...
26
2351
by: Jenitha S | last post by:
Hi, I am working in JSP code.A Menubar is displayed in JSP page.It's working fine in IE. But in case of firefox the very first menuitem is not working.If i move that menu item as second means it's working fine.Can anyone help me on this. XML code used: <menubar key="menubar_home" url="Home.do"/>Home
0
8483
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8402
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.