The form attribute on input is a special case. It was used before the HTML5 feature, to reference the parent form, but now it's used as an attribute as well, so you will have false positives on IE.
There is a checking function but it involves interaction with DOM which will probably affect performance, but here you go anyway. Hope it helps.
function testInputFormSupport() {
var input = document.createElement('input'),
form = document.createElement('form'),
formId = 'test-input-form-reference-support';
// Id of the remote form
form.id = formId;
// Add form and input to DOM
document.body.appendChild(form);
document.body.appendChild(input);
// Add reference of form to input
input.setAttribute('form', formId);
// Check if reference exists
var res = !(input.form == null);
// Remove elements
document.body.removeChild(form);
document.body.removeChild(input);
return res;
}