Databases Reference
In-Depth Information
uiw. showMessage();
} else {
uiw. hideMessage();
}
})
.blur(function() {
uiw. hideMessage();
});
The showMessage method contains the logic needed to place the warning message on the page. First
a check is made to see if the warning message is already on the page. If not, the HTML to show the
message is constructed and injected in the DOM.
showMessage: function() {
var uiw = this;
var html;
var warningId = uiw.element.attr('id') + ' CL WARNING';
if (!$('#' + warningId).length) {
html =
'<div class="ui-state-highlight ui-corner-all" style="width: ' +
uiw.options.warningMsgWidth +
'px; padding: 0pt 0.7em;" id="' + warningId + '"><table><tr><td>\n' +
' <span class="ui-icon ' + uiw.options.warningMsgIcon +
'" style="float: left; margin-right:0.3em;"></span></td><td>' +
' <p>' + uiw.options.warningMsgText +
'</p></td></tr></table></div>';
$('body').append(html);
Immediately after adding the warning message to the DOM, the position widget of jQuery UI is
used to move it to the correct location in the page.
$('#' + warningId).position({
of: uiw.element,
my: uiw.options.warningMsgAlignment,
at: uiw.options.passwordAlignment,
offset: uiw.options.offset,
collision: 'none'
});
}
},
The hideMessage method simply removes the warning message from the DOM when called.
hideMessage: function() {
var uiw = this;
var warningId = uiw.element.attr('id') + ' CL WARNING';
$('#' + warningId).remove();
}
Search WWH ::




Custom Search