Can we use pure javascript and dom here, see if it works for you.
var arr = [form1, form2, form3, form4];
var fn = function(arr){
var cur_frm = arr[Math.floor(Math.random() * arr.length)];
cur_frm.style.display = 'block';
for(i=0; i<arr.length;i++){
if(arr[i] != cur_frm) arr[i].style.display = 'none';
}
}
source
share