Advertisement

06.10.2003 at 05:56PM PDT, ID: 20643816
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.6

STORING COOKIES

Asked by Chers in JavaScript

Tags: ,

Hi, I created this code...it consist of 2 html pages with javascript/cookies. The first one (councilold.htm) contains checkboxes and one editbox. The user is required to enter their name and their favourite pages...when they click submit the cookie is stored and then open a new page (sidebarold.htm).

In page 2 (sidebarold.htm) when it is opened it will display all the values that the user entered in the first page (councilold.htm).

My code is only showing the name of the user entered..not the user's favourtie pages (checkboxes). Please re-check my code for me. Thank you so much!!!

This is all the codes...you may try it!
===============================================================
PAGE 1:  councilold.htm
===============================================================
<HTML>
<HEAD>
<TITLE>Student Council Preferences</TITLE>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function createCookie(name,value,days)
{
if (days)
{
     var date = new Date();
     date.setTime(date.getTime()+(days*24*60*60*1000));
     var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function addClub(Clubname, URL, Cookie)
{
      this.Clubname = Clubname
      this.URL = URL
      this.Cookie = Cookie
      return this
}      



function storeme()
{

var Clubs = new Array(6)

Clubs[0] = new addClub("Alumni Association", "alumni.htm", "interest1")
Clubs[1] = new addClub("Astronomy Club", "astronomy.htm", "interest2")
Clubs[2] = new addClub("Student Government", "studgovt.htm", "interest3")
Clubs[3] = new addClub("Radio and Television Club", "radio.htm", "interest4")
Clubs[4] = new addClub("Intramural Sports", "intramurals.htm", "interest5")
Clubs[5] = new addClub("Scuba Club", "scuba.htm", "interest6")

   var flag = 'N';
   var chkval = '';

    for(i=0;i<6;i++)
   {
        if(Clubs[i].Cookie)
        {
             flag='Y';
             if(chkval=='')
             {
                  chkval = Clubs[i].Cookie
             }
             else
             {
                    chkval = chkval + "," + Clubs[i].Cookie
             }              
          }
   }
   if(flag=='N')
   {
        alert("Please choose some options")
        return false;
   }
   else
   {    
          return createCookie("myfavsite",chkval,"");          
   }
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFCC" TEXT="#00384A">
  <CENTER>
    <img src="header1.gif" width="472" height="108">
    <p>
    <img src="please.gif" width="472" height="55"></p>
  </CENTER>

  <form NAME="frm" METHOD="post" ACTION="sidebarold.htm" ONSUBMIT="return storeme()">
  <CENTER>
    <TABLE BORDER=0>
        <TR>
            <TD>Name: </TD>
            <TD><INPUT TYPE="text" SIZE=20 NAME="favedit"></TD>
        </TR>
    </TABLE>
    <BR>
   
    <TABLE BORDER=0 CELLPADDING=2>
        <TR>
            <TD>Alumni Association</TD>
            <TD><input type="checkbox" name="interest1" value="ON"></TD>
            <TD WIDTH=50></TD>
            <TD>Astronomy Club</TD>
            <TD><input type="checkbox" name="interest2" value="ON"></TD>
        </TR>
        <TR>
            <TD>Student Government</TD>
            <TD><input type="checkbox" name="interest3" value="ON"></TD>
            <TD WIDTH=50></TD>
            <TD>Radio and Television Club</TD>
            <TD><input type="checkbox" name="interest4" value="ON"></TD>
        </TR>
        <TR>
            <TD>Intramural Sports</TD>
            <TD><input type="checkbox" name="interest5" value="ON"></TD>
            <TD WIDTH=50></TD>
            <TD>Scuba Club</TD>
            <TD><input type="checkbox" name="interest6" value="ON"></TD>
        </TR>
    </TABLE>
    <BR>
    <INPUT TYPE="submit" NAME="Continue" VALUE="Continue" onclick = "createCookie('myName',document.frm['favedit'].value,6)">
    <INPUT TYPE="reset" NAME="Reset" VALUE="Clear All">
  </CENTER>
  </FORM>

</BODY>
</HTML>
===============================================================
PAGE 2:  sidebarold.htm
===============================================================
<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function addClub(Clubname, URL, Cookie)
{
      this.Clubname = Clubname
      this.URL = URL
      this.Cookie = Cookie
      return this
}      

function readCookie(name)
{
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++)
{
     var c = ca[i];
     while (c.charAt(0)==' ') c = c.substring(1,c.length);
     if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
//-->
var Clubs = new Array(6)

Clubs[0] = new addClub("Alumni Association", "alumni.htm", "interest1")
Clubs[1] = new addClub("Astronomy Club", "astronomy.htm", "interest2")
Clubs[2] = new addClub("Student Government", "studgovt.htm", "interest3")
Clubs[3] = new addClub("Radio and Television Club", "radio.htm", "interest4")
Clubs[4] = new addClub("Intramural Sports", "intramurals.htm", "interest5")
Clubs[5] = new addClub("Scuba Club", "scuba.htm", "interest6")

function setEditMode()
{
      var date = new Date();
      var expires="";
      date.setTime(date.getTime() + (1000 * 60 * 60 * 24 * 365))
      document.cookie="EditMode=" + escape("true") + "; expires=" + date.toGMTString() +";"
      top.location.href = "council.htm";
}

</SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFCC">
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">

var cookieValue = readCookie("myName")
if (cookieValue != null)
{
      document.write("<TABLE BORDER=0 CEELPADDING=0 CELLSPACING=0 WIDTH=100%>")
      document.write("<TR ALIGN=CENTER><TD><B>Clubs of Interest</B></TD></TR>")
      document.write("<TR ALIGN=CENTER><TD><B>for</B></TD></TR>")
      document.write("<TR ALIGN=CENTER><TD><B>" + cookieValue + "</B></TD></TR>")
      document.write("</TABLE><BR>")
}      

document.write("<TABLE BORDER=0 CEELPADDING=0 CELLSPACING=12 WIDTH=100%>")
for (var i=0; i<6; i++)
{

      Cookiedefined = readCookie(Clubs[i].Cookie)
      if (Cookiedefined != null)
      {
            if (Cookiedefined == "true")
            {
                  document.write("<TR ALIGN=CENTER><TD><A HREF=" + Clubs[i].URL +" TARGET=LOWERRIGHT>" + Clubs[i].Clubname + "</A></TD></TR>")
            }
      }
}
document.write("</TABLE>")

</SCRIPT>

<center>
<A HREF="JavaScript:setEditMode();">  Change Preferences</A>
</CENTER>
</BODY>
</HTML>
===============================================================

Sorry my code is such a mess!!! That why I'm here to ask for help!!! Thank you sooo much!
I'm not really good using javascript/cookiesStart Free Trial
[+][-]06.10.2003 at 07:01PM PDT, ID: 8695857

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 09:22PM PDT, ID: 8696455

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 10:07PM PDT, ID: 8696646

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 10:52PM PDT, ID: 8696815

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 11:23PM PDT, ID: 8696931

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 11:23PM PDT, ID: 8696932

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 11:34PM PDT, ID: 8696980

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 11:38PM PDT, ID: 8697003

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 11:53PM PDT, ID: 8697095

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 11:54PM PDT, ID: 8697099

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2003 at 11:57PM PDT, ID: 8697114

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 12:00AM PDT, ID: 8697134

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 12:05AM PDT, ID: 8697163

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: ceelpadding, script
Sign Up Now!
Solution Provided By: hart
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.11.2003 at 12:11AM PDT, ID: 8697191

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 12:15AM PDT, ID: 8697214

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 12:25AM PDT, ID: 8697267

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 12:30AM PDT, ID: 8697295

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 12:38AM PDT, ID: 8697321

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 12:55AM PDT, ID: 8697388

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2003 at 01:09AM PDT, ID: 8697439

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2003 at 12:55AM PDT, ID: 8706530

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.12.2003 at 02:15AM PDT, ID: 8706976

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44