Hi,
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.
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.
The button has an name ending with diidIOSaveItem. I can't use ID or name with the datetime pickers.
if ($("input[title='Target Date']").val().length < 1)
{
$("input[name$='diidIOSaveItem']").hide();
}
else
{
$("input[name$='diidIOSaveItem']").show();
}
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?
Thanks in advance.
UPDATE
I know have:
$("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();
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?