This code lets you do something if the response back is of a certain length.
In this case if the database already had a tag called that, the response was shorter than if it had not. Therefore it would stop an action happening.
Cant figure out how to stop it if a string was actual text! (usually simple).
{
$.post("addtag.php", $("#newtag").serialize(),
function(data) {
// alert(data.length);
if(data.length == 22) {
} else {
var myOptions = {
val1 : x.value
};
$.each(myOptions, function(val, text) {
$('#oldtag').append( new Option(text,val) );
});
}
$("#formResponse").html(data);
}
);
return false;
}//end if











