How to use JavaScript to determine which radio button is selected when a form is submitted _ javascript skills

Source: Internet
Author: User
This article describes how to use JavaScript to determine which radio button is selected when a form is submitted. The example shows how to use javascript to operate the form radio button, which is very useful, for more information about how to use JavaScript to determine which radio button is selected when a form is submitted, see the example in this article. Share it with you for your reference. The specific analysis is as follows:

When the form is submitted, use JavaScript to determine which radio button is selected.

 Array (,), 1 => array (, 30, 30, 8, 2), 2 => array (, 30, 29, 3), 3 => array, 30,30, 29,30, 10,4), 4 => array (, 30,29, 30,29, 29,30, 29,29, 30,30, 29,0,), 5 => array (, 30,29, 30,30, 30,30, 29,29, 30,29, 30,29, 30,0,), 6 => array (, 30,30, 29,30, 29,30, 29,30, 29,30, 29,30, 29,30, 3,7), 7 => array (, 29, 30,29, 30,29, 30,30, 29,30, 29,30, 29,30, 29,0,), 8 => array (, 29,29, 30,30, 29,30, 29,30, 30,29, 30,0, 5, 9), 9 => array (, 29, 30,29, 29,30, 29,30, 29,30, 30,30, 29,30, 6,10), 10 => array (, 30,29, 29,30, 29,30, 29,30, 29,30, 30,30, 29,0 ), 11 => array (6, 30, 29, 30, 29, 30, 29, 29, 29, 30, 29, 30, 8, 12), 12 => array (0, 30, 29, 30, 29, 29, 30, 29, 29, 29, 29, 30, 30, 29, 29, 30,0, 9,1), 13 => array (, 30,29, 30,29, 29,30, 29,29, 30,29, 30,0, 10,2), 14 => array (, 30,29, 30,29, 30,29, 30,2 9, 30, 29,30, 29,29, 30,1, 3), 15 => array (, 29,30, 30,29, 30,29, 30,29, 30,29, 30,29, 30,0, 2, 4), 16 => array, 30,29, 30,29, 30,30, 29,30, 29,30, 29,0, 3,5), 17 => array (, 29,29, 30,29, 30,30, 29,30, 30,29, 30,29 ), 18 => array (, 29,29, 30,29, 30,29, 30,30, 29,30, 30,0,), 19 => array (, 30,29, 29,30, 29,29, 29,29, 30,30, 29,30, 30, 30, 6, 8), 20 => array (0, 29, 30, 29, 30, 29, 29, 30, 30, 30, 30, 0,), 21 => array (, 29, 29, 29, 30, 29, 29, 29, 29, 29, 29, 30,29, 30,30, 10), 22 => array (, 29,30, 30,29, 29,30, 29,29, 30,29, 30,30, 9,11), 23 => array (, 30,30, 30, 29,30, 29,30, 29,29, 30,29, 30,0, 10,12), 24 => array (, 30,30, 29,30, 30,29, 30,29, 30,29, 30,29, 29,0 ), 25 => array (,), 26 => array (, 30, 30, 30, 30, 29,0, 3,3), 27 => array (, 29,29, 30,29, 30,29, 30,29, 30,29, 30,30, 30,0,), 28 => array (, 30,29, 29,30, 29,29, 29, 29, 30,29, 30, 30, 30, 5), 29 => array (, 29, 29, 29, 29, 29, 29, 29, 30, 29, 30, 30, 30, 0, 6), 30 => array (, 30, 30, 30, 30, 29,29, 30,29, 29,30, 29,30, 30,29, 7,7), 31 => array (, 30,29, 30,29, 30,29, 29,30, 29,30, 29,30, 29,0 ), 32 => array (, 30, 30,), 33 => array (, 30, 30, 30, 29, 30, 30, 30, 30, 29, 29, 29, 29, 29, 30, 29, 30, 29, 30, 29, 29,30, 10,10), 34 => array (, 30,29, 30,30, 29,30, 29,30, 30,29, 30,0,), 35 => array (, 29,30, 29,30, 29,30, 29,30, 30, 30, 29, 3 ,), 36 => array (,), 37 => array (,), 37 => array (, 29, 29, 29,30, 29,30, 30,30, 29,0, 4,2), 38 => array (7,30, 30,29, 29,30, 29,29, 30,29, 30,30, 29,30, 5, 3), 39 => array (, 30, 30,29, 29,30, 29,29, 30,29, 30,29, 30,0, 6,4), 40 => array (, 30,29, 30,29, 30,29, 29,30, 29,30, 29,0, 7,5 ), 41 => array (6, 30, 29, 30, 30, 29, 30, 30, 29, 29, 29,), 42 => array (0, 30, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29 ,), 43 => array (,), 44 => array (,), 44 => array (, 30, 29,30, 29,30, 30,29, 30,30,), 45 => array (, 29,30, 29,29, 30,29, 30,30, 30,29, 30,29, 30,0,), 46 => array, 29,29, 30,29, 29,30, 29,30, 30,29, 30,0,), 47 => array (, 30, 29, 29,29, 30,29, 30,29, 30,30 ), 48 => array (,), 49 => array (, 9, 30, 6, 2), 50 => array (, 30, 30, 29, 29, 29, 30, 29, 30, 29, 30, 29, 0,), 51 => array (, 30, 30, 29, 30, 30, 29, 29, 30,29, 30,29, 30,0,), 52 => array (, 30,29, 30,29, 30,29, 30,29, 30,30, 29,30, 29,30, 9,5), 53 => array (, 30,29, 29, 29,30, 30,29, 30,30, 29,30, 29,0, 10,6), 54 => array (, 29,30, 29,29, 30,29, 30,30, 29,30, 30,0 ), 55 => array (,), 56 => array, 30, 0, ), 57 => array (,), 58 => array (,), 58 =>, 30,29, 30,0,), 59 => array (, 30,30, 29,30, 29,30, 29,30, 29,30, 29,30, 29,0, 6,12), 60 => array (, 30, 30,29, 30,29, 30,29, 30,29, 7,1), 61 => array (, 29,30, 29,30, 29,30, 29,30, 30,29, 30,29, 30,0,), 62 => array (, 29, 30,29, 29,30, 29,30, 30,29, 30,30, 29,0, 9,3), 63 => array (4,30, 29,30, 29,29, 30,29, 30,29, 30,30, 30,29, 10, 4), 64 => array (,), 65 => array (, 29, 29,29, 30,30, 29,0,), 66 => array (, 30, 30, 29,30, 29,30, 29,29, 30,29, 29,30, 30,29,), 67 => array (, 30,29, 29, 30,30, 29,29, 30,29, 30,29, 30,0,), 68 => array (7,29, 30,29, 30,30, 29,30, 29,30, 29,30, 29,30, 29,30 ), 69 => array (,), 70 => array (, 30, 30,, 0 ), 71 => array (,), 72 => array (, 30, 30, 30, 30,0, 9,1), 73 => array (, 29,30, 29,29, 30,29, 29,30, 30,29, 30,0, 10,2), 74 => array (, 30,29, 30,29, 30,29, 29,30, 29,29, 30,30, 29,30,), 75 => array (, 30,29, 30,29, 29,30, 29,29, 30,29, 30,0,), 76 => array (, 30,29, 30,29, 30,29, 30,29, 29,30, 29,30, 3,5), 77 => array (, 29,30, 30,29, 30,29, 30,29, 30,29, 30,29, 29,0,), 78 => Array (,), 79 => array (, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 29, 6, 8), 80 => array (, 29, 29, 30, 29, 30, 30, 30, 30, 30, 30,), 81 => array (, 30, 29, 29, 30, 29, 29, 29, 29, 30, 30, 30, 29,30, 30,0,), 82 => array (, 29,30, 29,29, 30,29, 29,30, 29,30, 30,30, 9,11), 83 => array (, 29,30, 29,30, 29,29, 29, 30,29, 29,30, 29,30, 30,0, 10,12), 84 => array (, 30, 29,30, 30,29, 29,30, 29,29, 30,29, 30,30,), 85 => Array (,), 86 => array, 3, 3), 87 => array (, 30,), 88 => array, 30,30, 29,0, 5), 89 => array (, 29,29, 30,29, 29,30, 30,29, 30,30, 30,0, 6,6), 90 => array (, 30, 29,29, 30,29, 30,30, 30,30, 7,7), 91 => array (, 30,29, 29,30, 29,29, 30,29, 30,30, 30,0,), 92 => arra Y (,), 93 => array, 10, 10), 94 => array (, 30, 30, 29,30, 29,30, 29,29, 30,29, 30,0,), 95 => array (, 30,30, 29,30, 29,30, 30,29, 29,30, 29,30,), 96 => array (, 30, 29, 30, 30, 29,30, 29,30, 29,30, 30,29, 29,0,), 97 => array (, 30, 29,30, 30,29, 30,30, 29,0,), 98 => array (, 29,29, 30,29, 29,30, 30,29, 30,30, 29,30, 5, 3), 99 => array (100, 29,29, 30,29, 29,30, 29,30, 30,30, 29,0, 6,4), => array (, 30,29, 29,30, 29,29, 30,29, 30,30, 29,0, 7,5 ), 101 => array (102,), => array, 29,0, 9,7), 103 => array (104, 30,29, 30,30, 29,30, 29,29, 30,29, 30,0, 10,8), => array (, 30,29, 30,30, 29,30, 30, 29,30, 29,30, 29,30, 105), 106 => array (, 30,29, 30,29, 30,29, 30,30, 29,30, 29,30, 29,0,), => ar Ray (7,30, 29,30, 29,30, 29,30, 29,30, 30,30, 3,11), 107 => array (, 29,30, 29,29, 29,29, 30,29, 30,30, 30,29, 30,0, 108), 109 => array (,), => array (, 30, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 30,29, 30,30, 110), 111 => array (, 29,30, 29,30, 29,29, 29,29, 30,29, 30,0,), => array (, 29,30, 30,30, 30,29, 29, 30,29, 29,30, 29,30, 29,0, 112), 113 => array (, 29,30, 30,29, 30,29, 30,29, 30,29, 30,29, 30,29, 9,5 ), => Array (114,), => array, 115), 116 => array (,), => array, 29,30, 30,0, 117), 118 => array (6,29, 30,29, 30,29, 29,30, 29,30, 29,30, 30,30,), => array (, 30,29, 30,29, 30,29, 29, 29,30, 29,30, 29,30, 30,0, 119), => array (, 29,30, 29,30, 29,30, 29,29, 30,29, 29,30, 30,0, 6, 12), 120 => array )); ############################# var $ mten = array (" null ", "A", "B", "C", "Ding", "Wu", "Ji", "Geng", "Xin", "Shen ", ""); # var $ mtwelve = array ("null", "Child (RAT)", "ugly (cow)", "Yin (Tiger )", "Mao (rabbit)", "Chen (Dragon)", "si (snake)", "Wu (horse)", "Wei (goat)", "Shen (monkey) "," you (chicken) "," Yellow (dog) "," Hai (pig) "); # var $ mmonth = array (" yellow ", "zheng", "2", "3", "4", "5", "6", "7", "8", "9", "10 ", "11", "12", "month"); var $ mday = array ("null", "1st", "2nd "," Third Day "," fourth day "," Fifth Day "," Sixth Day "," Seventh Day "," eighth day "," Ninth Day "," Tenth Day "," Eleventh Day "," Twelfth Day ", "13", "14", "15", "16", "17", "18", "19", "20", "Yi ", "August 2", "August 3", "August 4", "August 5", "August 6", "August 7", "August 8", "August 9 ", "Thirty "); # lunar day ############################### assign to the initial value # daily support var $ ten = 0; var $ twelve = 0; function MyPub ($ cYear, $ cMonth, $ cDay) {$ total = 11; # The total number of days of the Gregorian calendar to December 21, 1900 $ mtotal = 0; # total calendar days for ($ y = 1901; $ y <$ cYear; $ y ++) {$ total + = 365; if ($ y % 4 = 0) $ total ++;} # add the switch ($ cMonth) for several months in the current year {ca Se 12: $ total + = 30; case 11: $ total + = 31; case 10: $ total + = 30; case 9: $ total + = 31; case 8: $ total + = 31; case 7: $ total + = 30; case 6: $ total + = 31; case 5: $ total + = 30; case 4: $ total + = 31; case 3: $ total + = 28; case 2: $ total + = 31 ;} # if the year is a leap year, add a day if ($ cYear % 4 = 0 and $ cMonth> 2) {$ total ++;} $ total + = $ cDay-1; ############################# determine whether the number of days of the lunar calendar has exceeded days of the Gregorian calendar for ($ j = 0; $ j <= 120; $ j ++) {$ I = 1; for ($ I = 1; $ I <= 13; $ I ++) {$ mtotal + = $ this-> everyCMonth [$ j] [$ I]; if ($ mtotal >=$ total) {$ flag = 1; break;} if ($ flag = 1) break;} return array ("m" => $ j, "d" => $ I, "t" => $ total, "n" => $ mtotal);} function Cal ($ Year, $ Month, $ Day) {$ Par = $ this-> MyPub ($ Year, $ Month, $ Day ); $ md = $ this-> everyCMonth [$ Par ["m"] [$ Par ["d"]-($ Par ["n"]-$ Par [" t "]); $ week = ($ Par ["t"] + 5) % 7; if ($ this-> everyCMonth [$ Par ["m"] [0] <> 0 and $ this-> everyCMonth [$ Par ["m "] [0] <$ Par [" d "]) {$ mm = $ Par [" d "]-1 ;} else {$ mm = $ Par ["d"];} if ($ Par ["d"] ==$ this-> everyCMonth [$ Par ["d"] [0] + 1 and $ this-> everyCMonth [$ Par ["d"] [0] <> 0) {$ cMonth = $ this-> mmonth [0]. $ this-> mmonth [$ mm]; # leap month} else {$ cMonth = $ this-> mmonth [$ mm]. $ this-> mmonth [13];} return array ("year" => $ this-> mten [$ this-> everyCMonth [$ Par ["m"] [14]. $ this-> mtwelve [$ this-> everyCMonth [$ Par ["m"] [15], "month" => $ cMonth, "day" => $ This-> mday [$ md], "week" => $ week) ;}//// call $ test = new Calendar; $ Year = $ test-> Cal (sp_2, 20); echo $ Year ["year"]. "Year ". $ Year ["month"]. $ Year ["day"]. "Week ". $ Year ["week"];?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.