making value of form field blank if other is
<p>I looked around and couldn't find anything like this.  I have a field that holds a date.  Next to it is one that hold the number of hours.  </p>

<p>I need javascript to, on click, evaluate the date field, and if that's blank, automatically blank out the value of the text box to it's immediate left.</p>

<p>Part of the code of my form looks like this:</p>

<pre><code>  &lt;td&gt;Day One:&lt;/td&gt;
    &lt;td width="250"&gt; &lt;input type=date name="dayone" onClick="document.getElementsByName('hours1')[0].value=8;" /&gt;&lt;/td&gt;
    &lt;td&gt;Hours: (max 8) &lt;input type="text" name="hours1" id="hours1" class="smalltext" &gt;&lt;/td&gt;
</code></pre>

<p>That onclick just populates the text field with '8' as a default.  So I almost need something that undoes that if someone changes their mind and clears out the date from the other form field.</p>

<p>Thanks for the help!</p>
