Quantcast
Channel: Spiceworks Community - Latest topics
Viewing all articles
Browse latest Browse all 183785

using checkboxes in script

$
0
0

In my form I have checkboxes for days, Sunday through Saturday, field name is Days

I'm trying to check if day was selected then do something for that day ... lets say set day to number of the week it is, as I try to do here.

  1.  for each selectedValue in input.Days
  2.  {
  3.       if (selectedValue  ==  "Sunday")
  4.       {
  5.             day = 1;
  6.        }
  7.        if (selectedValue  ==  "Monday")
  8.       {
  9.             day = 2;
  10.       }
  11. // ... Tuesday ... Wednesday ... Thursday .... Friday ... Saturday ...
  12.       alert "number: " + day;
  13. }
is there a better way to do this?

Read More

Viewing all articles
Browse latest Browse all 183785

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>