fix Mate submission and JavaScript

- replace tabs with spaces, add missing semicolon
- rename ids of mate form fields to match JavaScript and ensure
  uniqueness of ids