Answered
I have two time boxes one is the Start time and the second is the End time of the event. I want to write a check that will not let the user submit the form if the times are incorrect. Start time has to come always before End time. I did this with dates but i dont know if it works with time only. I dont mind either Javascript or FormCalc help on this. thanks
Form.#subform[0].Button1::preSubmit:form - (Javascript, client)
var time1Num = Time2Num(starttime.rawValue,"HH-MM-SS")
var time2Num = Time2Num(endtime.rawValue,"HH-MM-SS")
if (time2Num < time1Num) then
xfa.host.messageBox("The End time must be after the Start time.","Input Error", 0, 0);
datecheck.mandatory = "error"
else
datecheck.mandatory = "disabled"
endif
//if start time is lower than end time.
if (Time2Num(starttime.formattedValue, "HH:MM") < Time2Num(endtime.formattedValue, "HH:MM")) then
//xfa.host.messageBox("start time is lower than end time.","Input Error", 0, 0);
datecheck.mandatory = "disabled"
else
//If start time is higher than end time we passed the date line
xfa.host.messageBox("start time is higher than end time .","Input Error", 0, 0);
datecheck.mandatory = "error"
endif
endif
got it and in my time control i have time{HH:MM:} for Display,Edit,Validate,Data