close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Validating End Date > Start Date

Thread began 7/13/2010 9:42 am by dinohorn397192 | Last modified 7/14/2010 2:58 pm by dinohorn397192 | 1656 views | 3 replies

Jimmy Wu

This requires a bit of modification on your part. You will have to change the min date to be changed dynamically based on the first form field. What I would recommend doing is to set some placeholder text into the min date field, so you can tell where in the code you need to make the change. In this example I used "aaaaaaaaaaaaaaa". I have applied date validation on the 2 fields, on the second one I have added the placeholder min date text. The validation code added looks similar to this:

php:
<?php 

if ($_SERVER["REQUEST_METHOD"] == "POST")  {
  
$WAFV_Redirect "";
  
$_SESSION['WAVT_untitled2_264_Errors'] = "";
  if (
$WAFV_Redirect == "")  {
    
$WAFV_Redirect $_SERVER["PHP_SELF"];
  }
  
$WAFV_Errors "";
  
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield"]))?$_POST["textfield"]:"") . "",true,".*","","",false,".*","","",true,1);
  
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield2"]))?$_POST["textfield2"]:"") . "",true,".*","aaaaaaaaaaaaaaa","",false,".*","","",true,2);

  if (
$WAFV_Errors != "")  {
    
PostResult($WAFV_Redirect,$WAFV_Errors,"untitled2_264");
  }
}
?>



You would want to make modifications so the code looks like this:

php:
<?php 

if ($_SERVER["REQUEST_METHOD"] == "POST")  {
  
$WAFV_Redirect "test.php";
  
$_SESSION['WAVT_untitled2_264_Errors'] = "";
  if (
$WAFV_Redirect == "")  {
    
$WAFV_Redirect $_SERVER["PHP_SELF"];
  }
  
$WAFV_Errors "";
  
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield"]))?$_POST["textfield"]:"") . "",true,".*","","",false,".*","","",true,1);
  
$WAFV_Errors .= WAValidateDT(((isset($_POST["textfield2"]))?$_POST["textfield2"]:"") . "",true,".*",((isset($_POST["textfield"]))?$_POST["textfield"]:""),"",false,".*","","",true,2);

  if (
$WAFV_Errors != "")  {
    
PostResult($WAFV_Redirect,$WAFV_Errors,"untitled2_264");
  }
}
?>



Basically what I have done is to check the value that was posted in the first checkbox and checked it against the one input in the second checkbox. To do this, I have replaced the "aaaaaaaaaaaaaaa" with ((isset($_POST["textfield"]))?$_POST["textfield"]:"")

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

Content

rating

Layout

rating

Ease of use

rating

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...