Change your event handler to address the form onsubmit
event rather than the submit buttons click
event. And return false if the user cancels :
frm.onsubmit = function(){
// confirm the data
var submitQ = confirm('Are you sure you want to submit your DSLR selections?');
if(submitQ)
{
alert('Your query has been submitted! Have a great day! :)');
} else {
// prevent the page from refreshing on Cancel option
return false;
}
};
see fiddle -> http://jsfiddle.net/LGd2f/