Hi

So far I have been able to make custom error boxes with the following code:
              $(".error").each(function(i, n){
                                $formElement = $(n).next('input, select');
                                $offset = $formElement.offset();
                                $left =
$offset.left+$formElement.width()+$formElement.parent().next(".error_exclamation_mark").width();
                                $top = $offset.top;
                                $(n).wrap("<div class=\"errorBox
clearfix\"></div>");
                                $(n).before('<div
class=\"errorBoxTitle\">Error</div>');
                                $formElement.after('<div
class=\"error_exclamation_mark\"></div>');
                                $formElement.wrap('<div
class=\"errorFormElement"></div>');

                                $(n).parent(".errorBox").css('position',
'absolute').css('left', $left).css('top', $top);
                              });

Open issues with that are :
- the code is being runned each time I hit the submit button, so the error
boxes are are duplicated.
 I dont know how to make it run just once.
-my dimension code get some positions wrong, I cant tell where it comes
from.

But that is peanuts compared to the pain of getting the "implies" rules to
work.
I just broke my head on that the whole afternoon and feel very frustrated.

The rules syntax seem easier on the yav website.

Sevir, you may want to add examples on your website.
If I can give some constructive critics:
-The code in the "alt" attribute may be indented. its just too long to read.
-Each example should have only one specific thing: for instance
http://projects.sevir.org/storage/yav/relationships.html
 that page demonstrates a relation + a custom rule.


Ok, that's what I can say for now, my brain is smoking ;-(

-Olivier


On 8/30/07, SeViR <[EMAIL PROTECTED]> wrote:
>
>
> I don't understand WHY you need pass a function for show the errors...
> The position of the
> errors in jQuery.YAV is related to the error element. So you can only
> pass jQuery transversing
> and manipulation functions ("after", "before", "prepend",....). The rest
> (the error visualization) can
> be set using CSS. You can also play with error elements after the
> validation process using "onError"
> function.
>
> As I see, your code seems show the error in a layer box. This example
> with jQuery.YAV can help
> you (the first example):
>
> The code:
>
> http://letmehaveblog.blogspot.com/2007/08/some-ideas-using-jqueryyav-plugin.html
> Run the example (clicking in the Go! button):
> http://projects.sevir.org/storage/yav/idea1.html
>
> Maybe you have the idea using validation plugin and you don't see that
> you can do similar things using
> other methods ;-)
>
> Jose
>
> Olivier Percebois-Garve escribió:
> > Hi
> >
> > I have a dilema between jquery validate and jqueryyav.
> >
> > I am using validate which offers great flexibility in the error
> > placement, because I can pass a function to it :
> >
> > errorPlacement: function(error, element){ ....
> >
> > jqueryYAV offers the "implies" that I need, but I cannot pass a
> > function to the error placement.
> > Its showError method looks like that :
> >
> > evalText = "jQuery('#"+ objError.id +"')." +
> > params.errorPosition +
> >       "(\"" +
> >       "<" + params.errorTag + " class='"+params.errorClass+"'>" +
> objError.msg + "</" + params.errorTag + ">"
> >
> >       + "\")";
> >
> > Is there a miracle solution ? ;-)
> > Will "implies" be integrated anytime soon in validate ?
> > Is jqueryYAV's code easily hackable in order to pass a function to the
> > errorPosition ?
> >
> > -Olivier
> >
> >
> >
> > PS: here is my actual errorPlacement code just to let know the sort of
> > thing I'm doing :
> >
> >     errorPlacement: function(error, element){
> >       element.after("<div class=\"error_exclamation_mark\"></div><div
> > class=\"errorBox clearfix\"><div
> > class=\"errorBoxTitle\">Error</div></div>");
> >           $left =
> > element.offset
> ().left+element.width()+element.next(".error_exclamation_mark").width();
> >           $top = element.offset().top;
> >       element.siblings("div.errorBox").css('position',
> > 'absolute').css('left', $left).css('top', $top);
> >       error.appendTo(element.siblings("div.errorBox"));
> >       if ($.browser.msie) element.wrap("<div
> > id=\"wrap_select_for_ie\"></div>");
> >     }
> >
> >
>
>
> --
> Best Regards,
> José Francisco Rives Lirola <sevir1ATgmail.com>
>
> SeViR CW · Computer Design
> http://www.sevir.org
>
> Murcia - Spain
>
>

Reply via email to