Il plug-in utilizza il posizionamento assoluto per i messaggi di errore.
Se si aggiungono altri elementi DOM che spostano la posizione dei campi di input rispetto al documento, sarà necessario riposizionare manualmente tutta la convalida <div> dopo che lo script che modifica il DOM viene eseguito.
Si potrebbe provare a utilizzare compensato la jQuery() Metodo http://api.jquery.com/offset/ per ottenere la nuova posizione dell'elemento di ingresso relativo al documento, e quindi modificare la convalida < s' div > proprietà superiore e sinistro di conseguenza.
Ecco un .jsFiddle che vi mostra cosa intendo: http://jsfiddle.net/ysQCf/2/
css
.errorMessage
{
background-color: red;
position: absolute;
left: 180px;
top: 25px;
}
p
{
display: none;
}
html
<p id="hidden">if you display this the textbox will move down</p>
<input id="myInput" type="text" />
<div class="errorMessage">stick me to the div</div>
<br />
<input id="show" type="button" value="Show" />
javascript
$(function() {
$("#show").click(function() {
// Save the offset of the error against the input
var offset = $(".errorMessage").offset();
offset.left -= $("#myInput").offset().left;
offset.top -= $("#myInput").offset().top;
// Call your script to manipulate the DOM
$("#hidden").show();
// Move the error div to it's new position
offset.left += $("#myInput").offset().left;
offset.top += $("#myInput").offset().top;
$(".errorMessage").offset(offset)
});
});