cleyan
Posts: 136
|
Posted: 07/04/2011, 10:05 PM |
|
Hi,
I use the following to show the error of a record in a modal window with jquery ui
1) Add into header section of the page
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/smoothness/jquery-ui.css" media="all">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/i18n/jquery-ui-i18n.min.js"></script>
2) Add the following javascript code into header section of the page or add to a common javascript file
<script type="text/javascript" >
jQuery(document).ready(function(){
$( ".errorbar:ui-dialog" ).dialog( "destroy" );
$( ".errorbar" ).dialog({
width: 500,
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
});
</script>
3) Change the standard html generated by wizard:
Change {error} to
<div class="errorbar">{Error}</div>
With this option all elements with class="errorbar" will we converted to a modal window If something is wrong and don't work all will be as before so the user don't see a problem, I hope this is usefull for some
Best Regars from Temuco in Chile
Carlos
_________________
**************************************************
Carlos Leyan B.
Temuco, Chile
www.leytec.net |