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>
</div>
after validation, when I look at it in firebug, the inputs with errors are followed by span.error. I would like to select these inputs. So far I have:
$.filter(function() { return $(this).next("span.error"); })
but I’m getting the following error:
TypeError: elems is undefined
[Break On This Error]
return elems.length === 1 ?
Can anyone give me a hand here?
Thanks,
Bill
Have you tried this?