I did this in the end (created a div called errorcontainer obviously).

$(document).ready(function(){
        var container = $("#errorcontainer");
        container.hide();
        $("#regform").validate({
                submitHandler: function(form) {
                        if ($("#seasonmember").val()=="0" && 
$("#season").val()=="0") {
                                container.show();
                        }
                        else {
                                form.submit();
                        }
                }
        });
});


On Mar 11, 6:13 pm, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:
> Using the validation plugin, set a required-rule for each field, after
> removing the value from the 0-option, that is, change it to <option
> value"">0</option>
>
> Jörn
>
> On Wed, Mar 11, 2009 at 6:57 AM, Mark King <m...@ampersand.net.au> wrote:
>
> > Hi.
>
> > I have two select boxes for differrent classes of tickets , like so:
>
> > <select name="seasonmember" id="seasonmember">
> > <option value="0">0</option>
> > <option value="1">1</option>
> > <option value="2">2</option>
> > <option value="3">3</option>
> > <option value="4">4</option>
> > <option value="5">5</option>
> > </select>
> > <select name="season" id="season"
> > <option value="0">0</option>
> > <option value="1">1</option>
> > <option value="2">2</option>
> > <option value="3">3</option>
> > <option value="4">4</option>
> > <option value="5">5</option>
> > </select>
>
> > I want to validate that at least one ticket has been purchased. I
> > would like to try to do this with the validate plugin, more for the
> > purposes of R&D than anything else (I could write some code to just
> > add up the values, but that's not really the point).
>
> > How would I go about doing this?
>
> > Thanks,
> > Mark

Reply via email to