javascript validation and order creation fix