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