I am working with twitter bootstrap and the jquery validate plugin
I have a form row that looks like:
<div class="form_row" >
<div class="control-group">
<label class="control-label" for="input01">home phone</label>
<div class="controls">
<input type="number" class="span4" class="input-xlarge" id="home_phone" name="home_phone" value="<?php echo $this->property->home_phone ?>" rel="popover" data-content="Re-enter your home phone." data-original-title="homephone" >
<input type="number" class="span4" class="input-xlarge" id="cell_phone" name="cell_phone" value="<?php echo $this->property->cell_phone ?>" rel="popover" data-content="Re-enter your cell_phone." data-original-title="cell_phone" >
</div>
after validation, when I look at it in firebug, the inputs with errors are followed by span.error. I would like to select the .control-group divs that have children which are span.error
$(".control-group").filter(function() { return !($(this).children().('span.error'))})
This doesn’t seem to be working. Can anyone get this working?
Thanks in advance,
Bill
This will select any item on the page with the class ‘control-group’ which has a span anywhere inside of it with a class of ‘error’.