close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Validating Event End Time - not before Event Start Time

Thread began 6/09/2011 5:04 am by iansheldon422428 | Last modified 6/14/2011 11:42 am by iansheldon422428 | 2254 views | 6 replies


Validating Event End Time - not before Event Start Time

Hi all,

I'm trying to implement validation of two select lists - one contains the start time of an event and one contains the end time.

Using Server Side Validations I want to check that the end time entered isnt before the start time. Sounds simple enough using the min feature of the Time Validation right?

Unfortunately I can't get it to work.

if (isset($_POST["BT_Insert_x"])) {
$WAFV_Redirect = "";
$_SESSION['WAVT_eventnewdates_622_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateDT(((isset($_POST["eventdate"]))?$_POST["eventdate"]:"") . "",true,"\b([12]\d|3[0-1]|0[1-9])\/(1[0-2]|0[1-9])\/\d{4}\b","","",false,".*","","",true,1);
$WAFV_Errors .= WAValidateDT(((isset($_POST["start"]))?$_POST["start"]:"") . "",true,".*","","",true,"\b(1\d|2[0-3]|0?\d):[0-5]\d(:[0-5]\d)?\b","","",true,2);
$WAFV_Errors .= WAValidateDT(((isset($_POST["end"]))?$_POST["end"]:"") . "",false,".*","","",true,"\b(1\d|2[0-3]|0?\d):[0-5]\d(:[0-5]\d)?\b","".$_POST["start"] ."","",true,3);

if ($WAFV_Errors != "") {

It only seems to validate the second part of the time, which increments in 15 minute intervals. So if the event starts at 9:30 then 10:15 would fail validation however 10:45 would pass, 11:00 would fail but 11:45 would pass.

Am I missing something really obvious here?

Both select lists for the start and end times are formatted the same:

<option value="08:00:00" <?php if (!(strcmp("08:00:00", (ValidatedField("eventnewdates_622","start"))))) {echo "selected=\"selected\"";} ?>>08:00</option>
<option value="08:15:00" <?php if (!(strcmp("08:15:00", (ValidatedField("eventnewdates_622","start"))))) {echo "selected=\"selected\"";} ?>>08:15</option>
<option value="08:30:00" <?php if (!(strcmp("08:30:00", (ValidatedField("eventnewdates_622","start"))))) {echo "selected=\"selected\"";} ?>>08:30</option>

Any help would be much appreciated.


Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...