There are several issues with the code.
1. The keyCode 32 is for space. The period sign is either 110 or 190. You can reference to
JavaScript Event KeyCodes[
^] to find out the correct key code for each keyboard character.
2. For comparison operator use == , = is for assignment, you can learn more from
JavaScript Operators[
^]
3. The logical operator is wrong (&&), (Logical AND) Returns true if both logical operands are true. Otherwise, returns false.
4. You might need to add extra logic to prevent user from entering many periods, like 1...2
<input id="test" type="text"
onkeydown="return (!(event.keyCode >= 65) || event.keyCode == 110 || event.keyCode == 190);" />