From bc39f6d40dbff3d08a6712d3e4c593d06033a680 Mon Sep 17 00:00:00 2001 From: Alib Date: Tue, 23 Feb 2010 19:24:27 +0100 Subject: add form validation check for timers --- javascript/functions.js | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'javascript') diff --git a/javascript/functions.js b/javascript/functions.js index bf32859..a708963 100755 --- a/javascript/functions.js +++ b/javascript/functions.js @@ -157,4 +157,36 @@ function str_pad (input, pad_length, pad_string, pad_type) { } return input; -} +} + +function checkform() +{ + + if ( document.timer.timer_name.value=="" ) + { + alert('Recording name is missing'); + return false; + } + else if ( document.timer.timer_chan.value=="" ) + { + alert('Select a channel to record'); + return false; + } + else if ( document.timer.timer_date.value=="" ) + { + alert('Select recording date'); + return false; + } + else if ( document.timer.timer_starttime.value=="" ) + { + alert('Select recording start time'); + return false; + } + else if ( document.timer.timer_endtime.value=="" ) + { + alert('Select recording end time'); + return false; + } + + return true; +} -- cgit v1.2.3