Uncaught TypeError: txtPartType.Value is undefined
This part explains the issue, you're attempting to resolve a property named
Value
on an input, but this is incorrect, it should be
value
(lowercase).
You can usually diagnose these problems by debugging the script in your browser and stepping through the code line by line.