amigos he intentado y he hasta el momento llevo lo siguiente
Código Javascript
:
Ver originalvar namec = $( "#namec" ),
allFieldsc =$( [] ) .add( namec )
function updateTipsc( t ) {
tipsc
.text( t )
.addClass( "ui-state-highlight" );
setTimeout(function() {
tips.removeClass( "ui-state-highlight", 1500 );
}, 500 );
}
function checkLengthc( o, n, min, max ) {
if ( o.val().length > max || o.val().length < min ) {
o.addClass( "ui-state-error" );
updateTipsc( "Length of " + n + " must be between " +
min + " and " + max + "." );
return false;
} else {
return true;
}
}
function checkRegexpc( o, regexp, n ) {
if ( !( regexp.test( o.val() ) ) ) {
o.addClass( "ui-state-error" );
updateTipsc( n );
return false;
} else {
return true;
}
}
$( "#dialog-modificar" ).dialog({
autoOpen: false,
height: 600,
width: 800,
modal: true,
buttons: {
"Modificar Destinatario": function() {
var bValidc = true;
allFielldsc.removeClass( "ui-state-error" );
bValidc = bValidc && checkLengthc( namec, "usernamec", 3, 16 );
y por medio de firebug me marca el siguiente error ReferenceError: allFielldsc is not defined
y me marca la siguiente linea de codigo allFielldsc.removeClass( "ui-state-error" );
leyendo un poco creo que tengo este mismo problema
http://stackoverflow.com/questions/6...-generated-ids
pero no se como solucionarlo por eso acudo a ustedes
en la misma pagina tengo
<div id="dialog-modificar" title="Modificar Destinatario">
<p class="validateTipsc">All form fields are required.</p>
<div id="insert">
<div class="columnas" id="col_1"><div id="consulta3"></div>
<label for="name">Nombre</label>
<input type="text" name="namec" id="namec" value="" class="text ui-widget-content ui-corner-all" />
</div>