我希望用户点击复选框,在进入下一页时,我希望存储该信息。如果用户希望返回并访问该页面,则会标记前一个复选框。
请忽略下面的代码,因为此网站需要发布某种代码,这只是一个填充。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="css/styles.css">
<title>Bootstrap</title>
</head>
<body>
<p>
<h1><u>Phase 2</u></h1>
<b>Leading Factors for Student Success </b>
<br><br>
<!--
<ul>
<li>Academic Advising</li>
<li>Time Management</li>
<li>Study Skills</li>
<li>Course Selection</li>
<li>Motivational Goals</li>
<li>Career Goals</li>
<li>Social and/or Personal Matters</li>
<li>Understanding University Policies and/or Procedures </li>
</ul>
-->
<ul>
<a href="#advising" data-toggle="collapse"onclick="academicadvisingFunction()"><input type="checkbox" id="c1"/ disabled> Academic Advising</a>
<div id="advising" class="collapse">
<br>
The College of Business Administration Academic Advisors and Staff are committed to student success. Your achievement at our school is important to us and we are here to help you through your academic goals, challenges, connect you with campus resources, address academic difficulties, set educational plans, assess your academic progress, review university policies and procedures and help you in your selection of courses among other academically related items.
<br><br>
<font size="2"><i>"Advising is a process in which advisor and advisee enter a dynamic relationship respectful of the student's concerns. Ideally, the advisor serves as teacher and guide in an interactive partnership aimed at enhancing the student's self-awareness and fulfillment." O'Banion, T. (1972). An academic advising model. Junior College Journal, 42, 62-69. </i></font>
<br><br>
</div>
<br>
<a href="#time" data-toggle="collapse"onclick="timemanagementFunction()"><input type="checkbox" id="c2"/ disabled> Time Management</a>
<div id="time" class="collapse">
<br>
Effective time management is <u>critical</u> to your success at the our school
As a general rule, you should expect to study at least <b>two hours</b> for every hour you are in class.
<ul><li>For example, if you are registered for 12 credit hours, you'll need at least 24 hours a week set aside for studying. If you have a job or other commitments, you may need to make adjustments to your course load or outside commitments.
</li></ul>
<br><br>
</div>
<br>
<a href="#study" data-toggle="collapse"onclick="studyskillsFunction()"><input type="checkbox" id="c3"/ disabled> Study Skills</a>
<div id="study" class="collapse">
<br>
The University Learning Resource Center (LRC) offers a variety of Study Skills resources such as handouts, videos, and tutoring tips to handle stress, improve communication skills, and provide strategies for test-taking. While working with your tutor, you can discuss techniques to improve your study skills.
<br><br>
The Learning Resource Center (LRC) Tutoring Programs are certified through the College Reading and Learning Association (CRLA), an international tutoring organization. The LRC's CRLA certification process sets an internationally accepted standard of tutor training for the purpose of providing tutors with skills, recognition, and positive reinforcement for successful work. The LRC tutoring services are free to all undergraduates and graduate students.
<br><br>
</div>
<br>
<a href="#course" data-toggle="collapse"onclick="courseselectionFunction()"><input type="checkbox" id="c4"/ disabled> Course Selection</a>
<div id="course" class="collapse">
<br>
Choosing inappropriate classes is a common reason students have academic difficulties.
<br><br>
Before registering for any class, check out the course description and the prerequisites. This information can be found in the class schedule.
When choosing courses, don't rely on friends and family too much. Rather, work with an academic advisor who can assist you with placement in courses, and help you to set up a balanced schedule.
<br><br>
Try to select a good mix of classes. When choosing a schedule, think about your academic strengths and weaknesses, and strive for balance.
<br><br>
</div>
<br>
<a href="#motivation" data-toggle="collapse"onclick="motivationalgoalsFunction()"><input type="checkbox" id="c5"/ disabled> Motivational Goals</a>
<div id="motivation" class="collapse">
<br>
If a lack of motivation is causing you to struggle at our school, it is important to examine why you are here.
<br><br>
If your reasons for attending the our school are external (to please others, for example), you may encounter problems. The most successful students go to school because they want to, not because they think they <i>must</i>.
<br><br>
It is often helpful for students to discuss their motivation and goals with an academic advisor. The advisors at the CBA Student Success Center can help you organize your thoughts and come up with options.
<br><br>
Another common reason students struggle with motivation is a lack of direction (no major or career goals). It is not uncommon to be undecided during your first year at the University, but if it is leading to poor performance, consider making an appointment with a Career Counselor.
<br><br>
</div>
<br>
<a href="#career" data-toggle="collapse"onclick="careergoalsFunction()"><input type="checkbox" id="c6"/ disabled> Career Goals</a>
<div id="career" class="collapse">
<br>
The Career Center’s goal is to provide you with resources and assistance to address all aspects of career planning and job search. Choosing your career or making a professional transition is a very exciting process and career counselors are here to help you.
</div>
<br>
<a href="#social" data-toggle="collapse"onclick="socialpersonalFunction()"><input type="checkbox" id="c7"/ disabled> Social and/or Personal Matters</a>
<div id="social" class="collapse">
<br>
If you're experiencing family or relationship problems, illness, or financial difficulties, it may be hard for you to focus on school.
<br><br>
If you think personal problems are the main reason you are not doing well, start to figure out how to resolve those difficulties now, before school becomes just one more problem. The Student Health & Counseling Services has trained counselors available to help students deal with personal issues.
<br><br>
You might also consider reducing your course load until you get things back under control. Talk with an academic advisor for more information about resources and options.
<br><br>
</div>
<br>
<a href="#policies" data-toggle="collapse"onclick="understandingpolicyFunction()"><input type="checkbox" id="c8"/ disabled> Understanding University Policies and/or Procedures</a>
<div id="policies" class="collapse">
<br>
To be a successful student, you will need to know how things "work" at
<br><br>
Some of the most important policies to be aware of are:
<ul>
<li>Grade Forgiveness policy</li>
<li>Course Withdrawal policy</li>
<li>Incomplete Grade policy</li>
<li>Leave of Absence policy</li>
<li>Retroactive Withdrawal policy</li>
</ul>
</div>
</ul>
<button id="submitbutton" onclick="submitFunction()"disabled>Submit Button</button>
<script>
function academicadvisingFunction() {
document.getElementById("c1").checked=true;
alert("Academic Advising Collapsed!");
}
function timemanagementFunction() {
document.getElementById("c2").checked=true;
alert("Time Management Collapsed!");
}
function studyskillsFunction() {
document.getElementById("c3").checked=true;
alert("Study Skills Collapsed!");
}
function courseselectionFunction() {
document.getElementById("c4").checked=true;
alert("Course Selection Collapsed!");
}
function motivationalgoalsFunction() {
document.getElementById("c5").checked=true;
alert("Motivational Goals Collapsed!");
}
function careergoalsFunction() {
document.getElementById("c6").checked=true;
alert("Career Goals Collapsed!");
}
function socialpersonalFunction() {
document.getElementById("c7").checked=true;
alert("Social and/or Personal Matters Collapsed!");
}
function understandingpolicyFunction() {
document.getElementById("c8").checked=true;
alert("Understanding University Policies and/or Procedures Collapsed!");
enablesubmitFunction();
}
function enablesubmitFunction()
{
if(
(document.getElementById("c1").checked) &&
(document.getElementById("c2").checked) &&
(document.getElementById("c3").checked) &&
(document.getElementById("c4").checked) &&
(document.getElementById("c5").checked) &&
(document.getElementById("c6").checked) &&
(document.getElementById("c7").checked) &&
(document.getElementById("c8").checked)
)
{
document.getElementById("submitbutton").disabled=false;
}
}
function submitFunction()
{
alert("Congrats you have met the requirements for Phase 2!");
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
</body>
</html>
答案 0 :(得分:1)
您可以使用本地存储,然后在数据使用完成后清除本地存储。
//商店
localStorage.setItem("lastname", "Smith");
//检索
document.getElementById("result").innerHTML = localStorage.getItem("lastname");
//删除
localStorage.removeItem("lastname");