Hide button depending of if textbox has text or not with jQuery?
<p>I have a a couple of datetime picker fields and if any of them is empty I want the Submit button to be invisible. I know how to do that but not how to make the button visible if all the datetime picker fields contains text.</p>

<p>I've seen exmaples using keyup but when I use the datetime picker I never put my cursor in the textbox and type something, the datetime picker populates the field.</p>

<p>The button has an name ending with diidIOSaveItem. I can't use ID or name with the datetime pickers.</p>

<pre><code>if ($("input[title='Target Date']").val().length &lt; 1)
{
$("input[name$='diidIOSaveItem']").hide();
}
else
{
$("input[name$='diidIOSaveItem']").show();
}
</code></pre>

<p>This hides the button if there's no set target date. How do I show the button if there's something in the field no mater how I put it there?</p>

<p>Thanks in advance.</p>

<p>UPDATE</p>

<p>I know have:</p>

<pre><code>$("input[title='Start Date']").bind('keyup keydown change', function () {
  if ($(this).val() == '') {
    $("input[name$='diidIOSaveItem']").hide();
  } else {
    $("input[name$='diidIOSaveItem']").show();
  }
}).change();

$("input[title='Target Date']").bind('keyup keydown change', function () {
  if ($(this).val() == '') {
    $("input[name$='diidIOSaveItem']").hide();
  } else {
    $("input[name$='diidIOSaveItem']").show();
  }
}).change();

$("select[title='Strategic Objective']").bind('keyup keydown change', function () {
  if ($(this).val() == 0) {
    $("input[name$='diidIOSaveItem']").hide();
  } else {
    $("input[name$='diidIOSaveItem']").show();
  }
}).change();

$("select[title='Strategic Priority']").bind('keyup keydown change', function () {
  if ($(this).val() == 0) {
    $("input[name$='diidIOSaveItem']").hide();
  } else {
    $("input[name$='diidIOSaveItem']").show();
  }
}).change();
</code></pre>

<p>If I don't have anything selected in one of the dropdownlists the button is hidden. However, if I select something in the dropdown lists the button becomes visible even though the datetime picker fields are empty. Suggestions?</p>
