Using jQuery is there a function that will tell me if the contents of a numeric array are in number order? For example;
[2,5,7,8,9] would return true [5,2,7,8,9] would return false
Scenario: I have an UL which is populated from mysql, the li items are text statements that have been randomly displayed, the id of the li is the rank order number the item should be for a correct sequence. The user then has to reorder the items by drag and drop using jQuery sortable. When the item is dropped I want jQuery to grap the reordered items via serialize into an array which I can then check to see if they are in numeric order which would indicate a correct answer. I've got everything working and I can pass the results back to php to validate to then show the answer in a separate div but I would like to do the checking on the client using jQuery rather than posting back to the server.
Treat me gently I'm a newbie