I am having a problem selecting a <form> at random, from <form>s created dynamically with jQuery, once the <submit> button has been clicked.
The code I am trying to use to select a <form> and hide all the rest is this (not entirely my own code, assembled from other similar asked on here):
$('.submit-button').live('click', function(){
var result = $("form").get().sort(function(){
return Math.round(Math.random())-0.5;
}).slice(0,1);
$(result).appendTo(result[0].parentNode).show();
});
If this helps, this is where I am currently developing the app:
http://yaocho-digital.com/teadecider/
This will find all the forms and hide all but a random one:
http://jsfiddle.net/nM8UL/