[LRUG] Double submit

Andrew Stewart boss at airbladesoftware.com
Fri Jan 17 06:22:43 PST 2014


> Curious, why are you specifying an html data type instead of js? What is supposed to happen when you submit the form?

The application tries to find the product identified by the product code from the text box.  If it finds it, it adds the product to the "basket" and renders a table row for the product via a partial.  (The basket is shown at the top of the search/checkout page as a table.)  An AJAX success handler bound to the form inserts the table row into the basket's table.

I wrote this five years ago and haven't needed to revisit it since.  These days there are doubtless better ways to handle AJAX responses and update the page ;)




More information about the Chat mailing list