diff --git a/include/Ajax.php b/include/Ajax.php
index 1fa756d..99abc22 100644
--- a/include/Ajax.php
+++ b/include/Ajax.php
@@ -87,7 +87,7 @@ class Ajax extends Responder {
         }
         $product = null;
         try {
-            $product = new Product($_POST['product'], 'serial');
+            $product = new Product(trim($_POST['product']), 'serial');
         } catch(Exception $e) {
             return new Failure('Ogiltigt serienummer.');
         }
@@ -102,7 +102,7 @@ class Ajax extends Responder {
     private function return_product() {
         $product = null;
         try {
-            $product = new Product($_POST['serial'], 'serial');
+            $product = new Product(trim($_POST['serial']), 'serial');
         } catch(Exception $e) {
             return new Failure('Ogiltigt serienummer.');
         }