First you need to search the element since it's name given by .net and it can be different so I'd search by partial name.
So this is something that should demonstrate what can be done. You need to test it.
var nextBtn = $($("[id$='WizardStepsNextPrev1_ButtonNext']")[0]);
var dialSummaryControl = $("#tdDialSummary").find('div').first();
if (nextBtn != null) {
var uStoreOnClick = nextBtn.attr('onclick');
nextBtn.removeAttr('onclick').click(function(Obj) {
var r= confirm (' Did I pass my custom validation?');
if(r)
{
// pass my value to ustore
//initiate ustore original call
jQuery.globalEval(uStoreOnClick) ;
}
else {
if(dialSummaryControl != null)
{
// show error div
dialSummaryControl.show();
//tell customer what should be fixed
dialSummaryControl.html('<ul><li>you need to fix it</li></ul>');
}
return false;
}
});
};