stefangabos / Zebra_Dialog

A small, compact, and highly configurable jQuery plugin for creating beautiful modal dialog boxes

Home Page:https://stefangabos.github.io/Zebra_Dialog/flat.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lost focus after close dialog.

Erick-BR opened this issue · comments

Hi, javascript "focus()" doesn't work after call zebra dialog as it work with default javascript alert. Its a field valitation in my case and this function is very important. Thank you.

$.Zebra_Dialog('test');
//alert("test");
form.frm_custo_pessoa_pf.focus();

Indeed, this doesn't work as the native alerts in the sense that it doesn't "freeze" the browser. Maybe you'll manage to do what you want by using buttons with custom callbacks

I think this should work:

new $.Zebra_Dialog('test', {
	buttons: [
		{caption: 'Ok', callback: function() {
			form.frm_custo_pessoa_pf.focus();
		}}
	]
});