views:

30

answers:

1

I am creating 2 drop down menus where the first is a start time, e.g. 8:00 am which uses a loop to generate the times, this works fine and the drop down menu has the desired time frames, now i need to create a script which returns as false if the start time is greater than the finish time and i have this:

var conting_timefrom=frm_conting.timefrom.value;  
 if(isNaN(conting_timefrom)){alert("You need to enter a starting time.");return false;}; 
 if(conting_timefrom.value>conting_timeto.value){alert("The time you have entered is after the finish time.");return false;}; 

however this doesn't work, any clues?

A: 
  1. bind event on selectind time in all menus
  2. im this eventhandlers functions get values of all time fields
  3. if one of them == "". alert this
  4. split values on hours and minutes (.split('')) and make in integers ("10" < "2")
  5. value = hours * 60 + minutes ....
  6. if value 1 < value 2 return true - else alert and return false
Falcon
I should probably post the whole code so it makes more sense:
craigg
....thats all the coding
craigg
USE EDIT!!!!!!!!!
Falcon
@craigg edit your question with your updates
Will