Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question window.history Question

    Hi Everyone !

    I am new to javascript and encountering a problem I can not work thru.

    This is my situation.

    I have a form which contains a checkbox. Based on whether or not that box is checked I enable 3 other checkboxes and a text field.

    <input onblur='window.status="";' onfocus='window.status="Select Box,
    if you want your backup to go to tape media. Otherwise backup will go to disk on
    ly";' type=checkbox name=dailybackup_backupToTapeFlag onClick="setBoxes();">

    I have written a function which tests the condition of the controlling checkbox and sets the other fields accordingly. (That works fine)

    The problem comes in when I advance to the next screen with the controlling checkbox checked and the subordinates enabled and populated, I provide a back button on the next screen which is using window.history.go(-1). When I test the back functionality. I return to the previous window and msie has the status of the controlling checkbox as "false".

    In Netscape it does not seem to have a problem knowing the state of the controlling checkbox when I return. Does anyone know what the problem is?

    My function is as follows:

    function setBoxes(){
    myForm=window.document.forms[0];

    tapeCheckbox=myForm.dailybackup_backupToTapeFlag;
    alert("tapeCheckbox is checked: " + tapeCheckbox.checked
    + "\nValue of tapeCheckBox is: " + tapeCheckbox.value
    + "\nName of tapeCheckBox is: " + tapeCheckbox.name);
    reportsCheckbox=myForm.dailybackup_ADD_report;
    usersCheckbox=myForm.dailybackup_ADD_users;
    programsCheckbox=myForm.dailybackup_ADD_programs;
    additionalsCheckbox=myForm.dailybackup_ADD_additionals;

    if (tapeCheckbox.checked == false){
    alert("TapeCheckbox is checked: " + tapeCheckbox.checked
    + "\nWill disable and checked=off");
    reportsCheckbox.checked=false;
    reportsCheckbox.disabled=true;
    usersCheckbox.checked=false;
    usersCheckbox.disabled=true;
    programsCheckbox.checked=false;
    programsCheckbox.disabled=true;
    additionalsCheckbox.value = "";
    additionalsCheckbox.disabled=true;
    additionalsCheckbox.style.backgroundColor="#D4D0C8";
    } else {
    alert("TapeCheckbox is checked: " + tapeCheckbox.checked
    + "\nWill enable");
    reportsCheckbox.disabled=false;
    usersCheckbox.disabled=false;
    programsCheckbox.disabled=false;
    additionalsCheckbox.disabled=false;
    additionalsCheckbox.style.backgroundColor="#ffffff";
    }
    }
    alert("Executing bottom");
    setBoxes();

    Thanks In Advance !

    jacQuestion

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    this has to do with the way the two browsers are programmed. Netscape/Mozilla remembers form input, IE doesn't. there's not much you can do about it, short of saving the information to a cookie
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <body onLoad=

    What is interesting about IE's behavior is that when the back button is clicked and the history -1 takes effect. IE knows the controlling checkbox was selected because it is checked.

    Also if I place, <body onLoad=setboxes();>

    IE behaves appropriately. Unfortunately our <body> statement is buried in an include and used by all pages to set static ui data.
    It would take quite a little refactoring to use this method.

    Appreciatively,

    Jim


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •