⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Adding an item right after adding an item gives JS error.



dano2
  • profile picture
  • Member

Posted 02 July 2015 - 08:43 AM

EDIT: Disregard this post!! I was dynamically changing the action after the first submit then not returning JSON. It didn't like that.

 

 

Hi. First-timer here. Lovin GC!

 

After successfully adding a new item, the form fields are emptied and the message "Your data has been successfully stored into the database" appears. All seems lovely, but when I populate the fields again with new data, and try to submit, I get a js error.

// The js error is "Uncaught SyntaxError: Unexpected token <" which when clicked reveals only the '<html lang="en">' line from the main page.
// This probably won't help much but the js debugger stops at the following "return" line of the jquery min page.
        if (a.JSON && a.JSON.parse)
            return a.JSON.parse(b + "");

I suspect there's something fishy with the ajax state maybe? I really have no idea, but I'm figuring if grocerycart is loading an empty form after a successful submission then the intent must be for that new form to work as well.