//
// This block of code extracts the
var var1 = location.search.substring(1, location.search.length) /* get everything after the ? */
// replace %20's with spaces so they're readable while (var1.indexOf("%20") != -1) { var index = var1.indexOf("%20") var first = var1.substring(0,index) var last = var1.substring(index+3,var1.length) var1 = first + " " + last }
// replace %26 with the & so we can find it while (var1.indexOf("%26") != -1) { var index = var1.indexOf("%26") var first = var1.substring(0,index) var last = var1.substring(index+3,var1.length) var1 = first + "&" + last }
// extract the two parameters myparams = var1.split("&") var param1 = "" var param2 = "" if (myparams.length > 0) { var param1 = myparams[0] } if (myparams.length > 1) { var param2 = myparams[1] }
var mon = "0" var day = "1" var year = "2016"
dateparts = param2.split("/") if (dateparts.length == 3) { mon = dateparts[0] day = dateparts[1] year = dateparts[2] } else { // see if it's in "May 23, 2016" format
dateparts2 = param2.split(",") if (dateparts2.length == 2) { dateparts3 = dateparts2[0].split(" ")
if (dateparts2.length == 2 && dateparts3.length == 2) { mon = dateparts3[0] day = dateparts3[1] year = dateparts2[1] if (year.length == 3 || year.length == 5) { year = year.substring (1, year.length) } } } else { // see if it's in 2016-05-23 format (or 05-05-23 -- the year is assumed first if dashes are used) dateparts4 = param2.split("-") if (dateparts4.length == 3) { mon = dateparts4[1] day = dateparts4[2] year = dateparts4[0] } } }
if (year.length == 2) { year = "20" + year }
var mon1=" " var mon2=" " var mon3=" " var mon4=" " var mon5=" " var mon6=" " var mon7=" " var mon8=" " var mon9=" " var mon10=" " var mon11=" " var mon12=" " var day1 = "" var day2 = "" var day3 = "" var day4 = "" var day5 = "" var day6 = "" var day7 = "" var day8 = "" var day9 = "" var day10 = "" var day11 = "" var day12 = "" var day13 = "" var day14 = "" var day15 = "" var day16 = "" var day17 = "" var day18 = "" var day19 = "" var day20 = "" var day21 = "" var day22 = "" var day23 = "" var day24 = "" var day25 = "" var day26 = "" var day27 = "" var day28 = "" var day29 = "" var day30 = "" var day31 = "" var year2016 = "" var year2017 = "" var year2018 = "" var year2019 = "" var year2020 = ""
if (year == "2016") { year2016 = "selected" } if (year == "2017") { year2017 = "selected" } if (year == "2018") { year2018 = "selected" } if (year == "2019") { year2019 = "selected" } if (year == "2020") { year2020 = "selected" }
if (mon == "1") { mon1 = "selected" } if (mon == "2") { mon2 = "selected" } if (mon == "3") { mon3 = "selected" } if (mon == "4") { mon4 = "selected" } if (mon == "5") { mon5 = "selected" } if (mon == "6") { mon6 = "selected" } if (mon == "7") { mon7 = "selected" } if (mon == "8") { mon8 = "selected" } if (mon == "9") { mon9 = "selected" } if (mon == "10") { mon10 = "selected" } if (mon == "11") { mon11 = "selected" } if (mon == "12") { mon12 = "selected" }
if (mon.substring(0,3) == "Jan") { mon1 = "selected" } if (mon.substring(0,3) == "Feb") { mon2 = "selected" } if (mon.substring(0,3) == "Mar") { mon3 = "selected" } if (mon.substring(0,3) == "Apr") { mon4 = "selected" } if (mon.substring(0,3) == "May") { mon5 = "selected" } if (mon.substring(0,3) == "Jun") { mon6 = "selected" } if (mon.substring(0,3) == "Jul") { mon7 = "selected" } if (mon.substring(0,3) == "Aug") { mon8 = "selected" } if (mon.substring(0,3) == "Sep") { mon9 = "selected" } if (mon.substring(0,3) == "Oct") { mon10 = "selected" } if (mon.substring(0,3) == "Nov") { mon11 = "selected" } if (mon.substring(0,3) == "Dec") { mon12 = "selected" }
if (day == "1") { day1 = "selected" } if (day == "2") { day2 = "selected" } if (day == "3") { day3 = "selected" } if (day == "4") { day4 = "selected" } if (day == "5") { day5 = "selected" } if (day == "6") { day6 = "selected" } if (day == "7") { day7 = "selected" } if (day == "8") { day8 = "selected" } if (day == "9") { day9 = "selected" } if (day == "10") { day10 = "selected" } if (day == "11") { day11 = "selected" } if (day == "12") { day12 = "selected" } if (day == "13") { day13 = "selected" } if (day == "14") { day14 = "selected" } if (day == "15") { day15 = "selected" } if (day == "16") { day16 = "selected" } if (day == "17") { day17 = "selected" } if (day == "18") { day18 = "selected" } if (day == "19") { day19 = "selected" } if (day == "20") { day20 = "selected" } if (day == "21") { day21 = "selected" } if (day == "22") { day22 = "selected" } if (day == "23") { day23 = "selected" } if (day == "24") { day24 = "selected" } if (day == "25") { day25 = "selected" } if (day == "26") { day26 = "selected" } if (day == "27") { day27 = "selected" } if (day == "28") { day28 = "selected" } if (day == "29") { day29 = "selected" } if (day == "30") { day30 = "selected" } if (day == "31") { day31 = "selected" }
// // OK, we have the variables -- see the examples below for how to insert them into your form // (These are simple examples using text form input -- modify as needed) //