"其它两页set"?
没明白。你最好说的详细点,如果帖下关键代码最好。

解决方案 »

  1.   

    大概这样<SCRIPT>
    function SetCookie(sName, sValue)
    {
      date = new Date(2008,1,1);
      document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString();
    }
    </SCRIPT><select onchange="SetCookie('a',this.value)">
    其它页面
    <SCRIPT>
    window.onload = function()
    {
    if(GetCookie("a") == "off")
    {
     document.formName.buttonName.disabled=true
    }
    else
    {
     document.formName.buttonName.disabled=false
    }
    }function GetCookie(sName)
    {
      // cookies are separated by semicolons
      var aCookie = document.cookie.split("; ");
      for (var i=0; i < aCookie.length; i++)
      {
        // a name/value pair (a crumb) is separated by an equal sign
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0]) 
          return unescape(aCrumb[1]);
      }  // a cookie with the requested name does not exist
      return null;
    }
    </SCRIPT>
      

  2.   

    例如
    a.htm
    ===============
    <SCRIPT>
    function SetCookie(sName, sValue)
    {
      date = new Date(2008,1,1);
      document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString();
    }
    </SCRIPT><select onchange="SetCookie('a',this.value)">
    <option value="on">on
    <option value="off">off
    </select>
    <a href="b.htm">next</a>
    b.htm
    =================<form name=formName>
    <input type=submit name="buttonName" value="提交">
    </form>
    <SCRIPT>
    window.onload = function()
    {
    if(GetCookie("a") == "off")
    {
     document.formName.buttonName.disabled=true
    }
    else
    {
     document.formName.buttonName.disabled=false
    }
    }function GetCookie(sName)
    {
      // cookies are separated by semicolons
      var aCookie = document.cookie.split("; ");
      for (var i=0; i < aCookie.length; i++)
      {
        // a name/value pair (a crumb) is separated by an equal sign
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0]) 
          return unescape(aCrumb[1]);
      }  // a cookie with the requested name does not exist
      return null;
    }
    </SCRIPT>