Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2006, 12:52 PM
Authorized User
 
Join Date: May 2004
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default I.E. Refresh problems

I have some problems with I.E.

I have an AJAX page which when a select box option is changed refreshes a search list. This works fine, I then added code to deal with back and refresh buttons so that on refresh the search is replayed. This involves setting the select options to those that they were before the refresh the running the code.

This works fine except that the display of the check box doesn't match the value it's been set to. In FireFox this is fine but in I.E. it doesn't refresh the values to the correct ones. It appears to hold the correct values but the list doesn't show this.

Here's the code which deals with the select boxes.

function handleManuHttpResponse() {
  if (http.readyState == 4) {
    if (http.responseText.indexOf('invalid') == -1) {

         var indexID = 0;

         var list = document.getElementById("make_F");
         var xmlDocument = http.responseXML;
         var items = xmlDocument.getElementsByTagName("manu");
         clearList(list);
         addElementToList(list, "-", "Select Manufacturer" );

         if (items.length > 0)
         {
           for (var i=0; i<items.length; i++)
           {
             var node = items[i];
             var manuid = node.getElementsByTagName("name")[0].firstChild.nodeValue;
             var manuname = node.getElementsByTagName("name")[0].firstChild.nodeValue;
             addElementToList(list, manuid, manuname);

             if (manuname == getSessionValue("makeSearch")){
               indexID = i+1;
             }
           }
         } else {
            alert("No Manufacturers found"); // This should never happen
         }
         document.getElementById("make_F").selectedIndex = indexID;
         document.getElementById("make_F").value = getSessionValue("makeSearch");
     }
    }
}

The getSessionValue and addElementToList functions as they are functions I have created to return stored session values add elements to the select list.

Any ideas?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Refresh Problems Andrew.Berry ASP.NET 2.0 Basics 2 December 17th, 2007 06:13 AM
Refresh GridView Using Refresh Button msbsam ASP.NET 2.0 Professional 0 December 6th, 2006 05:57 AM
Refresh surendran Javascript 7 August 3rd, 2004 05:31 AM
sessions problems: change on refresh ! papango Beginning PHP 4 July 28th, 2004 11:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.