Avatar

Level 2

Is it possible to test for what day of the week was selected in a Date field using javascript?

I have a script that checks if a "Day" radio button is checked and if so throws an error if the time entered is not between 6:00am and 3:30pm. I need to change the hours to between 6:00am and 2:30pm but only if the day of the week is a Friday (selected in the "Date" field).

Any ideas would really be appreciated.

if

(TimeReceived.isNull == true)

{

     xfa.host.messageBox("Please enter a Time Received");

     TimeReceived.rawValue

= null;

     xfa.host.setFocus("TimeReceived");

}

  else if ((TimeofCall.Day.rawValue ==0))

{

          if (TimeReceived.rawValue.search(":") > 0)

                    val1 = TimeReceived.rawValue.replace(":", "");

          else

                    val1 = TimeReceived.rawValue;

          if (val1 < 600 || val1 > 1530)

          {

               xfa.host.messageBox("If 'Time of Call' has Day selected, then the 'Time Received' must be within normal working hours (06:00 to 15:30).Make sure you are using military time, please re-enter.");

               TimeReceived.rawValue

= null;

               xfa.host.setFocus("TimeReceived");    
     }
}