Fixed small bug in js

Calling value() on a jquery object is undefined. Use val() instead.
Whoops!