473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

2
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 1934
acoder
16,027 Expert Mod 8TB
Can you post your code please.
Nov 28 '07 #2
kepskp
2
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 Expert Mod 8TB
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
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....
3
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...
6
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...
7
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...
1
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...
9
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">...
5
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...
3
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"...
1
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...
26
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.