Without completely understanding what you're up to:<br><br>1. I think you should be using a date *element* to do this if you're not already, so you validate the element as you would expect. But you probably already knew that. (And doesn't the date module provide this?) If not, and you want to roll your own, <a href="http://api.drupal.org/api/examples/form_example--form_example_elements.inc/6/source">form_example_elements.inc </a>in the Examples Form Example shows how to do it. You could then use a '#validate' function to short-circuit validation...<br>
<br>2. If you're already using a date element to do this, you probably need to make a #validate that mushes the values into nothing when they haven't selected anything. I suspect that you're currently getting a value that doesn't equate to empty after you've changed those form elements.<br>
<br>Sorry if I've missed the point, but one of those two ought to help.<br><br>-Randy<br><br><div class="gmail_quote">On Thu, Mar 17, 2011 at 10:40 AM, Jeff Hartman <span dir="ltr"><<a href="mailto:lists@jeffhartman.com">lists@jeffhartman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Sorry. Drupal 6.<br>
<div><div></div><div class="h5"><br>
On Mar 17, 2011, at 11:38 AM, Randy Fay wrote:<br>
<br>
> Hi Jeff, and everybody: When you post a question like this, please say what version of Drupal you're talking about. The D7 answer to this question is a fair bit different from the D6 answer.<br>
><br>
> -Randy<br>
><br>
> On Thu, Mar 17, 2011 at 9:53 AM, Jeff Hartman <<a href="mailto:lists@jeffhartman.com">lists@jeffhartman.com</a>> wrote:<br>
> I have a birthdate date field in a form where I am using #after_build to modify. The modifications to the drop down values are:<br>
> - add a "select month", "select day", and "select year" options to their respective drop downs<br>
> - change the range of years in the year drop down<br>
><br>
> This field(s) is not required. However, if I don't select anything in the drop downs and leave each on the "select month/day/year" values, Drupal validation tells me that the selected date is not valid.<br>
><br>
> How can I tell Drupal to skip this validation? Even if I try to validate this field in hook_form_validate it still tells me the data is invalid.<br>
><br>
> Jeff<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Module and Site Development<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>