NAME="date_form"; $form->METHOD="POST"; $form->ACTION=""; $form->debug="trigger_error"; $form->InvalidCLASS='invalid'; $form->ShowAllErrors=1; /* * The following lines are for testing purposes. * Remove these lines when adapting this example to real applications. */ if(defined("__TEST")) { if(IsSet($__test_options["ShowAllErrors"])) $form->ShowAllErrors=$__test_options["ShowAllErrors"]; if(IsSet($__test_options["today"])) $today=$__test_options["today"]; if(IsSet($__test_options["start_date"])) $start_date=$__test_options["start_date"]; if(IsSet($__test_options["end_date"])) $end_date=$__test_options["end_date"]; } $form->AddInput(array( "TYPE"=>"custom", "ID"=>"date", "LABEL"=>"Date", "ACCESSKEY"=>"D", "CustomClass"=>"form_date_class", "VALUE"=>$today, "Format"=>"{day}/{month}/{year}", "Months"=>array( "01"=>"January", "02"=>"February", "03"=>"March", "04"=>"April", "05"=>"May", "06"=>"June", "07"=>"July", "08"=>"August", "09"=>"September", "10"=>"October", "11"=>"November", "12"=>"December" ), "Optional"=>1, "ValidationStartDate"=>$start_date, "ValidationStartDateErrorMessage"=>"It was specified a schedule date before the start date.", "ValidationEndDate"=>$end_date, "ValidationEndDateErrorMessage"=>"It was specified a schedule date after the end date.", )); /* * The following lines are for testing purposes. * Remove these lines when adapting this example to real applications. */ if(defined("__TEST")) { if(IsSet($__test_options["set_date"])) { $form->SetInputValue('date', $__test_options["set_date"]); echo $form->GetInputValue('date'); return; } } $form->AddInput(array( "TYPE"=>"submit", "VALUE"=>"Schedule", "NAME"=>"doit" )); $form->LoadInputValues($form->WasSubmitted("doit")); $verify=array(); if($form->WasSubmitted("doit")) { if(($error_message=$form->Validate($verify))=="") $doit=1; else { $doit=0; $error_message=HtmlEntities($error_message); } } else { $error_message=""; $doit=0; } if(!$doit) $form->ConnectFormToInput('date', 'ONLOAD', 'Focus', array()); $onload=HtmlSpecialChars($form->PageLoad()); ?> Test for Manuel Lemos' PHP form class using the date plug-in input

Test for Manuel Lemos' PHP form class using the date plug-in input


GetInputValue("date"); if(strlen($date)) { ?>

The task is scheduled to be started on

The task was not scheduled.

StartLayoutCapture(); $title="Form Date plug-in test"; $body_template="form_date_body.html.php"; include("templates/form_frame.html.php"); $form->EndLayoutCapture(); $form->DisplayOutput(); } ?>