Programming
Javascript and cookies

Question Description

hi programmers!


I have this simple HTML form just for testing purposes.

<form id = "myform" onsubmit = "return checkcheckboxes()">

Box 1<input type = "checkbox" name = "chk1">

Box 2<input type = "checkbox" name = "chk2">

Box 3<input type = "checkbox" name = "chk3">

<input type = "submit" value = "Go to the next task">

<span id = "message">congratulations! you have completed all the tasks completely</span>

</form>

<script type = "text/javascript">

function checkcheckboxes() {

document.getElementById("message").innerHTML = "";

var valid = true;

var f = document.getElementById("myform");

if (f.chk1.checked == false) {valid = false}

if (f.chk2.checked == false) {valid = false}

if (f.chk3.checked == false) {valid = false}

if (!valid) {document.getElementById("message").innerHTML = "You must check all three boxes to proceed"};

return valid;

}

</script>


Now i wanna do 2 things

  • when a submit button is clicked, it sends the user to the next task(link)
  • i also wana trigger a cookie, so when they complete one task, the information is saved on the cookie, and when the user closes the window or get back to it later, task 2 will be showing up not task 1(every task has a different link)


Final Answer

This can be easily achieved in Jquery? Do you want to use Jquery? I can answer this for $3

henry (1070)
UIUC

Anonymous
Return customer, been using sp for a good two years now.

Anonymous
Thanks as always for the good work!

Anonymous
Excellent job

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors