title: How do I use beforeValidate() in CakePHP?
body: <p>I have a form with a URL field. The default value for this field is: http://. But the field is not required. The user can skip it and submit the form. It shouldn't return an error because it's not required and because they didn't enter a URL. But right now it does, because of the http://. </p>
  
  <p>I heard I can use beforeValidate() to check if it's http://, and then clear the URL field, allowing me to skip the error message.</p>
  
  <p>But I don't know how to use beforeValidate(). I searched Google, but I did not find any working examples. Where do I place the code for beforeValidate()? Is it a function? How do I access the submitted form data from there?</p>
  
  <p>Thanks.</p>