Javascript indexOf

Zdá se, že se snažíte získat hodnotu vstupu FirstName . getElementById() vrací pouze samotný uzel. Místo toho přistupte k jeho hodnotě:

var FirstName = document.getElementById('FirstName').value;
var CardMessage = document.getElementById('Message').value;

// Then use the variable `FirstName` instead of the quoted string
var aPosition = CardMessage.indexOf(FirstName);

// Best practice would be to use === for strict type comarison here...
if (aPosition === -1)
  alert("Name Not In Message.");
}

Všimněte si také, že jste napsali chybně getElementById s velkým D na konci, kde by měla být malá.