Re: [jQuery] A call for your styles! Regarding accordion, treeview, tooltip and validation plugins

2007-03-28 Thread Jörn Zaefferer
Benjamin Sterling schrieb:
> Jörn,
> Feel free to use the what I have at: http://www.informationexperts.com/
>
> Let me know if you need me to clean it up.
Thanks, I'll take a look. Its a bit, well, slow, but looks great.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] A call for your styles! Regarding accordion, treeview, tooltip and validation plugins

2007-03-28 Thread Jörn Zaefferer
Hi folks,

I've just added the styles that an user of my accordion plugin uses on 
his site to the accordion demo (thanks for the permission, not online 
yet). I've looking at it, I noticed that this gives everyone not only a 
way fancier demo, but also a good repository of styles to start with. 
Just pick the behaviour and presentation you need and have to do much 
less customization. Good for both of us.

Basically I'd like to ask everyone who may be using one of my plugins 
(accordion, treeview, tooltip, validation [0]) if you can donate some 
stylesheet. The easiest way: Give me a link to your site using the 
plugins and your permission to put those in the demos.

Thanks for your participation!

[0] http://bassistance.de/jquery-plugins/

PS: An accordion spinoff is coming soon!

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery vs prototype

2007-03-27 Thread Jörn Zaefferer
Michel Brouckaert schrieb:
> If you have more time and the project would be a really big one, i 
> would advice you to rather use Prototype. Class based designs mostly 
> only pay off in huge projects because of reusability. So at the end of 
> the line I think it depends...
I think reusing jQuery code by putting it in the form of plugins works 
great in "big" projects too. After all, a big project can only work if 
its carefully assembled of small parts. And those small parts can be 
jQuery plugins.

Of course there are aspects,  mostly domain-specific, that are not well 
represented as plugins. But I wouldn't implement those in JavaScript anyway.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Accrodian - background image changing on select (one working, other's are not)

2007-03-27 Thread Jörn Zaefferer
Jörn Zaefferer schrieb:
> pjhawksr schrieb:
>   
>> However, my second question is how do I get the accordian to stay open and
>> only close when the toggle link is click (not automatically closing when
>> another item in the accordian is clicked)?
>>   
>> 
> That isn't possible currently, but considering the requests, I'll add it 
> as soon as possible. Btw., is "accordion" ;)
>
> And in your code, you have two plugin calls, seems like you should 
> remove the second call, as it won't match any elements.
>   
Thinking about it some more, and playing around with the current code I 
noticed that your request completely defeats the purpose of the 
accordion. An accordion is all about allowing just one element open at a 
time (or none at all), and the plugin does just that. Making it to allow 
more then one open is much more complicated then simply writing a 
different plugin for that purpose. I thats what I'm gonna do. By porting 
most of the options from the Accordion (optional animations, custom 
event etc.) it isn't as trivial as writing it on the fly. Hope that 
works for you...

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Release: Validation plugin beta 2

2007-03-27 Thread Jörn Zaefferer
Aaron Heimlich schrieb:
> On 3/27/07, *Jörn Zaefferer* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> 
> wrote:
>
> I'd really like to take a look at your code that
> produces the validation rules from serverbased stuff.
>
>
> The project is at http://aheimlich.freepgs.com/projects/php/hvalidator 
> <http://aheimlich.freepgs.com/projects/php/hvalidator>, but my host is 
> giving me trouble right now (I'm moving to Dreamhost anyway, because 
> my current one sucks @$$). I can email you the code if you want, but I 
> haven't gotten to JSON exporting yet (it's on my todo list and should 
> get done sometime soon considering I'm going to be using all of this 
> in my current project).
Ok, thanks. Let me know when you got that JSON export ready, that seems 
to be the most interesting part. I take a look at the page once its 
back. Or you give me a different address.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery vs prototype

2007-03-27 Thread Jörn Zaefferer
Denis schrieb:
> can you help me?
> what benefits of JQuery vs prototype?(http://www.prototypejs.org/)
>   
You may find jQuery's community very, very active, friendly and helpful. 
Something I haven't seen or experienced in this form in any other open 
source project.

Something that may weigh much more then any technical aspects once you 
get used to it :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Accrodian - background image changing on select (one working, other's are not)

2007-03-27 Thread Jörn Zaefferer
pjhawksr schrieb:
> However, my second question is how do I get the accordian to stay open and
> only close when the toggle link is click (not automatically closing when
> another item in the accordian is clicked)?
>   
That isn't possible currently, but considering the requests, I'll add it 
as soon as possible. Btw., is "accordion" ;)

And in your code, you have two plugin calls, seems like you should 
remove the second call, as it won't match any elements.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Quality control for plugins

2007-03-27 Thread Jörn Zaefferer
Brian Cherne schrieb:
> On 3/26/07, *Jörn Zaefferer* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> 
> wrote:
>
> Unfortuanetely, Javadoc is a bit limited for documenting jQuery
> plugins.
> For example, most plugins offer "options", that is, they accept a
> object
> whose properties are used to override any set defaults. How do you
> document all these options via Javadoc?
>
>
> That is a very good question and a serious limitation. Do you think no 
> standard is better than an incomplete standard? Maybe someone should 
> come up with jQueryDoc ;-)
We are pretty close to scriptdoc, but not the same. I wonder if John 
could move the efforts around scriptdoc to the jQuery community, that 
could help alot to bring both forward.
> And back to Howard's initial message: Is there a standard for plug-ins 
> to follow?
I've read a lot of plugin code since I came to jQuery, and wrote some 
parts of the current plugin authoring guide. That was more an approach 
to document standards, instead of actually standarizing anything. Of 
course those change pretty fast, and currently I consider the guide to 
be out of date on several parts. Mainly because my own coding style 
changed a lot, as you can observe by comparing my tooltip plugin and the 
accordion or the treeview ;)

There is one important convention that every plugin should, maybe even 
must stick to: Provide sensible defaults for every option, and make it 
possible to customize as much as reasonable. The result is that everyone 
can start using a plugin withou reading too much or any documentation at 
all.
That sets the inital barrier very low, something I consider very 
important. I hate having to give up using some great framework or 
software just because its too hard to get it working the first time and 
I lack the time to do it.
By providing lots of options, based on actual requirements or requests, 
a plugin can be pushed around to do anything you like it to. After 
figuring out how to use a plugin, its easy to learn how to customize it.
I'm adding additonal features to my plugins once there are one or two 
requests for it, seems to work pretty well so far.

I hope that babbling about my own experiences on those could answer your 
question a bit.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Release: Validation plugin beta 2

2007-03-27 Thread Jörn Zaefferer
Aaron Heimlich schrieb:
> Jorn,
>
> Great stuff so far!
>
> I wonder, though, if it would be possible to have settings.rules and 
> settings.messages be organized by element name instead of element ID.
>
> If I'm trying export server-side validation rules to your plugin (as 
> JSON and then converted into your settings format by a small wrapper), 
> the server-side validation processor may not know what each element's 
> ID attribute is.
>
> I suppose, in my wrapper, I could take all of the element names and 
> find the appropriate IDs, but it seems like it would be easier if 
> settings.rules and settings.messages were organized by element name.
Thanks for bringing this up. I already though about it once or twice, 
and considering some other issues, it seems like I will drop IDs 
entirely. To avoid a serious performance lost, I just have to pass 
elements around instead of their IDs. And it shouldn't be too hard to 
emulate the label-for-input associations with jQuery. As I have to drop 
labels as error messages by default anyway, I need to implement that. It 
should be possible to mix both: If someone prefers to use labels as 
error messages and has assigned IDs to input, I can use that ID in the 
for attribue, otherwise I emulate the behaviour.

One more thing: I'd really like to take a look at your code that 
produces the validation rules from serverbased stuff. For one thing, I 
want to write a tutorial that takes you through the basics and details 
of using the validation plugin, and I'd like to include some information 
about a deeper serverside integration then the current demos provide. 
Personally I'm working with Java based JSF, and its not trivial to 
generate the rules I'd need from JSF's validation rules. Being able to 
show how one approach would work should give enough ideas to solve in 
other enviroments or languages, too.

I hope you can share something, be it on this list or private.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Quality control for plugins

2007-03-26 Thread Jörn Zaefferer
Brian Cherne schrieb:
> The Java engineers at my company told me about Javadoc... I didn't 
> even think to look for JSDoc... but it's essentially the same. I 
> haven't needed to extract the Javadoc code into a MSWord document, but 
> I think such tools already exist. I'll ask around. The other day when 
> I gave Aptana a trial-run I was happily surprised to see it reading my 
> Javadoc comments into a tooltip when I paused while thinking "what 
> parameters does this function take again"...
>
> But the biggest benefit is just in having consistent commenting of 
> functions. For instance, the Javadoc for my plug-in will read 
> something like:
Unfortuanetely, Javadoc is a bit limited for documenting jQuery plugins. 
For example, most plugins offer "options", that is, they accept a object 
whose properties are used to override any set defaults. How do you 
document all these options via Javadoc?

Among the rather incomplete tools to generate HTML from jQuerys inline 
docs is my little doc tool: 
http://jquery.bassistance.de/docTool/docTool.html
You can download it to modify the XSL stylesheet to produce different 
output. It currently works only on Firefox and needs to run on a webserver.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] google takes over my error div!!!

2007-03-26 Thread Jörn Zaefferer
amircx schrieb:
> umm... there is no other tag for replacement? im using it for somthing
> *
>   
Good point, thanks. I guess I have to find a combination of elements 
that is easy to style, does not interfere with Google Toolbar and makes 
some semantic sense. That can hardly be achieved without a certain loss 
of flexibility, but it should be a good thing to set certain standards 
as long as they work well.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Gurus - best Javascript references?

2007-03-25 Thread Jörn Zaefferer
Karl Swedberg schrieb:
> When that jQuery book comes out, I hear it's going to have an awesome 
> Appendix dealing with closures. ;-)
No way!!

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] google takes over my error div!!!

2007-03-25 Thread Jörn Zaefferer
Klaus Hartl schrieb:
> Dan G. Switzer, II schrieb:
>   
>> Jörn,
>>
>> 
>>> Thanks for investigating. It would be easy to make the element used for
>>> error messages customizable. What would you recommend as the default?
>>> The Google Toolbar problem can occur everywhere, so the label-default
>>> seems like a bad idea now.
>>>   
>> Well, my initial thought was a , but perhaps the  tag would be
>> more semantically correct. 
>>
>> The  is supposed to be used to "emphasis" text, and what needs more
>> emphasis than an error message?
>> 
>
> Too bad! From a semantic standpoint I'd use:
>
> ...
>   
Yeah, but that poses the same problem we are trying to solve. I like 
. "em" like error message :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Is the JQuery slowest?

2007-03-25 Thread Jörn Zaefferer
Juha Suni schrieb:
> When adding lots of automated stuff, especially when trying to make it all 
> really really easy to use through binding to classes and general html 
> structures, it can get pretty heavy. We've had the need to strip out stuff 
> cause of selector slowness on large forms and pages with lots of dynamic 
> fields with lots of event binding and element selection going on.
>   
Have you done any profiling to check where the biggest performance 
bottlenecks are? I'd find that quite interesting.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] google takes over my error div!!!

2007-03-23 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb:
> I suspect this is because Google is inserting content into any  tag
> it sees--which is what Jorn's (I wish I could remember the keystroke to get
> the accent right in Jorn's name) Form Validation Plug-in uses.
>
> My guess is if this was switched to some other element, the problem would go
> away.
>
> Some Googling seems to confirm that the Google Toolbar does something
> w/ tags, so I really think this is the problem.
>   
Thanks for investigating. It would be easy to make the element used for 
error messages customizable. What would you recommend as the default? 
The Google Toolbar problem can occur everywhere, so the label-default 
seems like a bad idea now.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Gurus - best Javascript references?

2007-03-23 Thread Jörn Zaefferer
Daemach schrieb:
> I have no formal programming training, so I often brute-force things 
> that could be a lot more elegant.  One thing I'm struggling with in 
> particular now is the benefits of creating object prototypes over just 
> storing data in a global tree.  A few people on this list have taken a 
> shot at explaining some of this to me, and thank you very much for 
> that, but it's just not sinking in which is unusual and frustrating.
>
> Can you all tell us what books are good for advanced Javascript 
> reference?  Closures, objects, advanced functions, etc.  I've been 
> doing DOM programming long enough that I can find a way around pretty 
> much every problem but I want to take my game to the next level.
>
> Your help is much appreciated!!
You may want to try books about object-oriented programming. Working 
with a object-oriented language alone doesn't make you an oo-programmer, 
eg. you can programm fully procedural programs with Java. Once you get 
the idea why packaging data with behaviour is good, you should be able 
to find your way around JavaScript better.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Beta Testers needed for Form Plugin file upload support

2007-03-22 Thread Jörn Zaefferer
Mike Alsup schrieb:
> If you're interested in the code you can find it all tucked into the
> end of the ajaxSubmit method in a function called "fileUpload".
>   
Can't currently help with testing, buts its great you took up the 
challenge and implement this into jQuery's form plugin. Thanks Mike!

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ANNOUNCE: Tabs 2.7

2007-03-22 Thread Jörn Zaefferer
Klaus Hartl schrieb:
> All,
>
> I've just committed an update for Tabs. I've added a few requested 
> features and fixed some quirks.
>   
Already love it. The make-it-pretty-fix alone is worth an update :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin Requests

2007-03-22 Thread Jörn Zaefferer
BKDesign Solutions schrieb:
> Am debating whether its appropriate to post requests from clients for 
> estimates-paying work on the list?
>   
Well, good ideas are also worth some money.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Validation Plugin Beta 2 Bug - Radio Buttons

2007-03-22 Thread Jörn Zaefferer
Ryan Rose schrieb:
> Dan,
>
> That fixed it. Now everything is working as expected. Thanks for the help.
>   
Excellent work guys, I'll just add the fix to the plugin and claim 
having fixed another bug, thanks :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] New Window Handle?

2007-03-21 Thread Jörn Zaefferer
emckenna schrieb:
> So does that mean that JQuery can not be called on the new window?
> ie .. new_win_ref.$("some-selector").css('color', 'red');
> If it can, what's the syntax?
>   
The thing I was referring to was $("div#someid", print_win.document): 
jQuery 1.0.3 would ignore the given context for the ID selector.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Validation plugin: on blur using ajax

2007-03-20 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb:
> Gareth,
>
> In order to get this to work the way you have it, you'd have to do a
> "synchronous" call to the server, which wouldn't be AJAX (the "A" is for
> asynchronous.) :)
>
> Because the code you have is running asynchronously, the AJAX call is fired
> off and then the validation routine continues on its way. However, when the
> server responds back, your callback function runs--which displays the alert.
>
> You should be able to do a synchronous call using the $.ajax() function, but
> it's pretty much always a bad idea to rely on synchronous operations (since
> if something happens during the transmission--it can really cause problems.)
>
> For asynchronous validation, I'd recommend doing those as a separate remote
> call and then have once the validation returns, have it fire off the rest of
> the local validation. You could build a queuing of remote validation rules
> that get fired off and once all the rules have returned, run the local
> validation.
>
> Just be aware that AJAX validation can really cause UI issues if the server
> is unresponsive.
>   
Hardly anything to add, thanks Dan, once again.

I still want to enable client-side validation on submit and keyup and 
ajax validation on blur without to much effort on the clients side (the 
user of the plugin).

So far you have to manully trigger the ajax validation, and then use the 
validator object (returned by the validate method) to display error 
messages via the showErrors() method ( 
http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatorprotoypeshowErrorsMap
 
).

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Release: Validation plugin beta 2

2007-03-20 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb:
>> I'd have to take a look at your demo page, but it sounds like what you
>> need to use is the errorPlacement option. That allows you to customize
>> the placement of generated labels (instead of the default, insert after
>> invalid element). Let me know if that doesn't work in your scenario.
>> 
>
> I guess I could use the errorPlacement, but that can get ugly when it's
> really only one error message you want to move.
>
> Take a look at your example page:
> http://jquery.bassistance.de/validate/demo-test/
>
> My code is almost identical (because it's seeded from your example.)
> However, on the "Please agree to our policy" line, I've moved the checkbox
> *before* the phrase--which is generally where people put it.
>
> When you do this, the default placement for this one label isn't in a good
> spot--it gets placed between the checkbox and the text. My work around was
> to put this line after the "please agree" text:
>
> 
>
> Having to add the "generated" attribute makes the markup fail validation.
>   
Thanks for detailing this example. If have placement of generated labels 
at radio buttons and checkboxes still on my know issues list, this 
should help solving that.

I'm not 100% sure how you would like to have the error message 
displayed, you could paste a more complete example? Or page? Whatever 
shows where the error should be in relation to the checkbox.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin released: textify. PROBLEMS UNSOLVED

2007-03-20 Thread Jörn Zaefferer
Abel Tamayo schrieb:
>  but others like support for snippets I don't even know what that 
> means. Also, I couldn't find better icons for foreground and 
> background colors; I thought those were OK.
Okay, I write together a "usecase", more details hopefully coming later.

I want to write a post on my blog containing a few code snippets. 
Something about jQuery. So I start with a few paragraphs of text, maybe 
adding a bit bold text here and there, or a few subheadlines. Now comes 
the first HTML snippet I want to present. I copy a bit of HTML from a 
demo page, and insert it as escaped HTML into the page. Here the editor 
has to present a one- or two-click approach of inserting this: 
(pasted, escaped html).
A few lines later I want to insert a bit JavaScript, no escaping 
neccessary, but I want to have the correct pre/code tags around it: 
(pasted js).
Another few lines later I have some inline Javascript, somewhere in a 
sentence: (pasted js).

I wouldn't mind configuring support for JS and other languages I'd like 
to use, but at least the HTML support with escaping must be built-in.

The actualy syntax-highlighting on the code elements (according to the 
given class) is done by the excellent Chili plugin 
(http://www.mondotondo.com/aercolino/noteslog/?cat=8).

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] New Window Handle?

2007-03-20 Thread Jörn Zaefferer
Eric Mckenna schrieb:
> Found one piece to my puzzle.
> There is no $(expr, context) in 1.0.3. 
> That function comes with 1.1.2
>
>   
That isn't the right piece. I'm pretty sure that $(expr, context) 
already existed in 1.0.3, its just that we worked on the documentation.

The issue that was fixed in 1.1.0 is this: You are using an ID selector 
with a context, but jQuery 1.0.3 ignores that context and simply uses 
document.getElementById.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] [JQuery] Attribute selector

2007-03-20 Thread Jörn Zaefferer
Klaus Hartl schrieb:
> Klaus Hartl schrieb:
>   
>> It's a common misunderstanding that classes are 
>> for style.
>> 
>
> ... that classes are for style *only*.
>   
No class, no style!

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin released: textify. PROBLEMS UNSOLVED

2007-03-20 Thread Jörn Zaefferer
Abel Tamayo schrieb:
>
> is it possible to bind it to an input field or a textarea? Without
> javascript the iframe has no function on the page. I think the
> easiest way to do this is to check if the tag is an iframe, if
> it's not get the dimensions of the element and replace it with an
> iframe.
>
>
> I think that's a wonderful idea. I add it to the to-do list.
I second that! The serverside code can the simply generate a plain 
textarea that is transformed on the client-side.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Release: Validation plugin beta 2

2007-03-20 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb:
>
> Jorn,
>
> Also, while preparing my demo I found I needed to explicitly declare 
> in the HTML where a validation error might appear for a given form 
> field. I had to actually go into the code to determine the correct way 
> to format the  tag.
>
> What happens if you want a static message, you do:
>
> 
>
> Please select at least two topics you'd like to receive.
>
> 
>
> If an error occurred for a field with the ID or NAME attribute of 
> “topic”, this label would be displayed.
>
> However, if you want to define the exact placement of an error for a 
> dynamic message (i.e. generated from the message maps or from the 
> rules themselves) you have to do:
>
> 
>
> I had to dig through the code to figure out I needed to manually add 
> the “generated” attribute. Also, doing this makes the markup invalid.
>
> I’d like to see a better method of mapping individual error messages 
> to the correct element on the screen. Perhaps another mapping option:
>
> $("#form").validate({
>
> rules: {email: {required: true}},
>
> messages: {email: "Please enter an e-mail address."},
>
> errorElement: {email: "#errorEmail"}
>
> });
>
> Where the errorElement structure would allow you to define the element 
> in which the error gets displayed. I’m not sure I like the name 
> “errorElement”, but you get the idea.
>
I'd have to take a look at your demo page, but it sounds like what you 
need to use is the errorPlacement option. That allows you to customize 
the placement of generated labels (instead of the default, insert after 
invalid element). Let me know if that doesn't work in your scenario.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Release: Validation plugin beta 2

2007-03-20 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb:
> For example, for radio & checkbox elements you use the NAME attribute, but
> for everything else you use the ID attribute. I just find it confusing to
> try to explain the difference (on when you use what.)
>   
Currently I'm internally passing around element IDs. I want to remove 
that as far as possible, maybe I can reduce the need for IDs, too.

There is one good argument for using IDs: You can click the error labels 
to focus the associated input, without any additional JS, just using the 
for attribute.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin released: textify. PROBLEMS UNSOLVED

2007-03-20 Thread Jörn Zaefferer
Abel Tamayo schrieb:
>
> I don't really have any idea about your current issue.
>
>
> Well, I guess that means my Firefox is broken, since I'm still getting 
> that error wich sucks cause I'd hate to reinstall it with all the 
> plugins, passwords, etc...
I get the same exception! We either have the same plugins installed 
causing the issues, or its something else (which is more likely).
> As for the rest of your recommendations (all of them very 
> appreciated), some of them I already had in mind, but others like 
> support for snippets I don't even know what that means. Also, I 
> couldn't find better icons for foreground and background colors; I 
> thought those were OK.
Ok, I try to put a little specification together for code snippets, 
hopefully that gets you the right idea. Its something I'm really missing 
from virtually every browser rich text editor I've seen so far.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] [JQuery] Attribute selector

2007-03-19 Thread Jörn Zaefferer
Magnús Örn Gylfason schrieb:
> Ok, but according to the jquery documentation "[EMAIL PROTECTED]" is a valid 
> selector, as in:
>
> $("//[EMAIL PROTECTED]")
>
> to find all input elements that are checked.
>
> I tried that specific approach
>
> $("//[EMAIL PROTECTED]")
>
> and it still only finds "three".
The problem here may be that checked is a special attribute that 
defaults to true when specified without an actual value. Try this and 
check the results:


$("input")[0].check
$("input")[0].checked
$("input")[0].getAttribute("check")
$("input")[0].getAttribute("checked")

My results:
undefined
true
""
""

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] [JQuery] Attribute selector

2007-03-19 Thread Jörn Zaefferer
Magnús Örn Gylfason schrieb:
> Putting an empty string there has no effect, still only finds input three
I guess it doesn't find that because there is no value specified for the 
attribute (an empty string is the same as none at all in that case), so 
it assumes the element doesn't have that attribute.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin released: textify. PROBLEMS UNSOLVED

2007-03-19 Thread Jörn Zaefferer

Abel Tamayo schrieb:

Hi everyone.

Finally I'm releasing the plugin I've been so busy developing in the 
last month. Textify (see homepage) <http://scriptinverse.com/textify/> 
It's a function that transforms a regular iFrame element into a text 
editor and I hope it will serve everyone who needs it well. Think of 
all the possibilities: email applications, blog, forums, maybe chats...
I don't really have any idea about your current issue. But your plugin 
looks very good so far, so I want to give at least some general feedback:


   * I'd like to see which style is currently selected, eg. make the
 toolbar buttons push buttons that are "active" when, err, active
   * Your To Add list contains "Contextual menu to edit styles.": There
 is already a great context menu plugin, and Chris is working on it
 to make it more context-sensitive, I guess both plugins could
 profit from each other
   * "Support for insertHTML feature. Lightbox-light plugin required."
 - jQuery offers several xxx-box-style plugins, the rewritten
 thickbox could be a good choice
   * "PNG bug in IE6." - I think there is already one "official"
 fix-png plugin which you could use, or put its code into your plugin
   * "Provide a compressed version.": I'm using a modified build.xml of
 jQuery's build to pack and package my plugins, that makes new
 releases quite easy, let me know if you need help setting that up
   * The icons for colors are not intuitive
   * The clear button would deserve a confirm (hopefully not using an
 actual js-confirm)
   * one of the features I find quite useful in Office 2007 are those
 inline-style-popups: Select a part of your text, move the mouse in
 the right direction (its always in the same corner) and a
 tooltip/hover popup appears with the most important
 style-toolbar-buttons

And the really most important feature request I have: Please, please 
please add proper support for inserting code snippets! That includes 
creating pre/code tags, adding proper classes to the code element (to 
allow Chili to do its fantastic work), (automatically, can be disabled) 
escaping HTML elements.


And once you added the code-snippet support, I'd like to (optionally) 
deactivate the rest and just work with plain HTML and escaped code snippets.


Let me know if I can help with that, eg. specifying the requirements in 
more detail.


--
Jörn Zaefferer

http://bassistance.de

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Release: Validation plugin beta 2

2007-03-19 Thread Jörn Zaefferer
Dan G. Switzer, II schrieb:
>
> Jorn,
>
> One thing I’d like to see is a way to reset a specific field’s error 
> status. I wrote this as a hack:
>
resetField() makes sense as a companion to resetForm(). Would be less 
hackish then.
>
> Also, maybe this has changed in beta 2, but I’d think using the ID 
> attribute for some fields and the NAME attribute for others is 
> confusing for the error labels. I’d rather see the use of just the 
> NAME attribute—so it’s consistent across the board.
>
The idea is to always use IDs, but generate them using names when they 
are not available. So far that seemed to work quite well, do you have a 
specific example where it didn't work out?

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Release: Validation plugin beta 2

2007-03-18 Thread Jörn Zaefferer
The validation plugin beta 2 is out! If you are already working with it: 
A update is recommended. If not, and you need client-side validation 
(pure or mixed with AJAX requests), check it out: 
http://bassistance.de/jquery-plugins/jquery-plugin-validation/


Recent changes:

   * Improved dependecy feature by adding two custom expressions:
 ":blank" to select elements with an empty value and ":filled" to
 select elements with a value, both excluding whitespace
   * Added a resetForm() method to the validator: Resets each form
 element (using the form plugin, if available), removes classes on
 invalid elements and hides all error messages
   * Fixed docs for validator.showErrors()
   * Fixed error label creation to always use html() instead of text(),
 allowing arbitrary HTML passed in as messages
   * Fixed error label creation to use specified error class

Have fun!

--
Jörn Zaefferer

http://bassistance.de

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Removing readonly attribute from textarea

2007-03-16 Thread Jörn Zaefferer
Rob Desbois schrieb:
> All,
>
> What's the 'correct' way to change a  to and from readonly. 
> The following works for me, but I wanted to particularly check the 
> removal:
>$("#myTextArea").attr("readonly", "readonly"); // Make read-only
>$("#myTextArea").attr("readonly", ""); // Make read-write
Have you tried $("#myTextArea").attr("readonly", true/false);?
>
> Thanks,
> rob
>
> -- 
> Rob Desbois
> Eml: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> ----
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>   


-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Animation question

2007-03-15 Thread Jörn Zaefferer
Daemach schrieb:
> Hmm - I'm not sure how or why someone would rely on a hidden element
> appearing instantaneously and then animating back to its original state.  I
> suppose it's possible, but those have to be rare enough cases that the
> benefits to new jQuery converts would take precedence.
>
> Things like animate, fadeTo, toggles, etc. are a different issue.  I'm just
> talking about the fadeIn, fadeOut, slideIn and slideOut effects which are
> essentially wrappers for the animate function.
>
> I did create a ticket - thanks for the prompt.
>   
show()/hide() are already protected against that issue by filtering 
accordingly.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Advantages of adding functions to jQuery

2007-03-15 Thread Jörn Zaefferer
Daniel MacDonald schrieb:
> I believe I got it, using:
>
> jQuery.log = {
>   error : function() { ... },
>   warning : function() { ... },
>   debug : function() { ... },
> }; 
>
> as opposed to:
>
> var log = {
>   error : function() { ... },
>   warning : function() { ... },
>   debug : function() { ... },
> }; 
>
> prevents a conflict with some other script that uses log in the global
> scope. Of course, I still have to watch out for other jQuery.log objects.
>   
Right. But at least its safe to assume that any code that places itself 
in the jQuery namespace requires jQuery to run.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Advantages of adding functions to jQuery

2007-03-14 Thread Jörn Zaefferer
Daniel MacDonald schrieb:
> It seems the former opens up the door to unintended closures. What are the
> benefits of doing it this way as opposed to the traditional non-jQuery way?
>   
Thats it! By putting everything into a single global object, there isn't 
the chance of colliding with other libraries or global objects in general.

Mike answered the other issue :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] [validation plugin] addError help!

2007-03-14 Thread Jörn Zaefferer
philguillard schrieb:
> Many Thanks.
> I took time to answer cause it was not working for me and i didn't want 
> to make you waste your time.
> Downloading the plugin today and deleting 
> that i was hardcoding in the form (preventing the new message to be 
> displayed), i get it working.
>   
Ok, good to know you managed to solve the issue.

It may help to know that I recently changed the errorContainer and 
errorLabelContainer options a bit, which may have caused confusion: 
errorContainer only shows and hides containers with whatever content, 
while errorLabelContainer is used to append the error labels. Seperating 
them gives you much more flexibility.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] hoverIntent = my first plug-in

2007-03-14 Thread Jörn Zaefferer
Brandon Aaron schrieb:
> Maybe I can make more sense today ... hopefully. Lets say I had a
> plugin that depended on this plugin and I changed the defaults in my
> plugin. Now when the developer includes my plugin, the defaults have
> been changed and the expected behavior of the plugin is different.
> That would be very frustrating as a plugin developer and a developer
> using the plugins.
>
> My plugin:
> ...
> jQuery.hoverIntent.defaults = { sensitivity: 10, interval 500 };
> ...
>
> Now, my plugin depends on those "defaults" and the developer has
> changed the defaults to something completely different. Of course as a
> plugin developer I could *not* depend on the defaults but they
> shouldn't be called defaults then. I believe it is best to keep the
> defaults internal and not allow others to change the defaults for all
> implementations of the plugin. It could also be a problem if the
> defaults have been changed on a very big project with lots of
> developers. I don't think it is a good idea to have a general
> setDefaults function either unless it was per an instance based, not
> global for the plugin.
>
> Hopefully that made more sense.
>   
Yep, it does. I understand the issue you are referring to, but don't see 
that as critical.

A simple example: Validation plugin depends (by default) on metadata 
plugin. It doesn't care how the metadata plugin is configured, as long 
as it works as expected.

So the trick should be to allow customization without breaking dependend 
plugins.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ANNOUNCE: The treemap plugin

2007-03-13 Thread Jörn Zaefferer
Renato Formato schrieb:
> Jörn Zaefferer ha scritto:
>   
>> I like that. Dunno yet what I'd need that for, but I'll keep it in mind. 
>> Could you please add the link to the plugin list in the wiki and provide 
>> demo links at the top of your plugin site? Thanks.
>>
>> 
> Other than the Alexandre suggestion (in fact treemaps have been already 
> used instead of tag clouds but, as far as I know, never with a 
> javascript implementation), you can unobtrusively show statistics, even 
> hierarchically
>
> Ex: How many jQuery files have been downloaded for each version?
> You can have a table with the data and, optionally, show a treemap with 
> a hierarchical treemap for each major, minor and bugfix release. We have 
> done the same thing with SPIP. 
> (http://trac.rezo.net/trac/spip-zone/browser/_dev_/top10/stats.html)
>   
Nice.

Though my stupid point was: I don't have a particular project where I 
currently need just that. Of course it helps to know what those projects 
should look like to need it :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] hoverIntent = my first plug-in

2007-03-13 Thread Jörn Zaefferer
Brandon Aaron schrieb:
> I thought about this approach as well but then you gotta think that
> this is a plugin that others will use and possibly other plugins might
> depend on it as well. Then if the defaults changed, the plugin that
> depends on it could be confused and break. It is easy enough for a
> devloper to setup their own set of defaults that would not cause an
> issue like this.
>
> var myHoverDefaults = { interval: 250 };
>
> Now just pass that in and your set and don't potentially break any
> other plugins.
>
> As an example ... I'm updating my bgiframe plugin to accept an options
> hash. If I allowed a developer/plugin to change the defaults then all
> the plugins that depend on the defaults would then break.
>
> Hopefully that all made sense ... I'm writing it in a bit of a rush.
>   
Err, maybe, maybe not. Either way, I had a big mistake in my code 
example. Corrected:

jQuery.fn.hoverIntent = function (on,off,options) {
   var settings = jQuery.extend({}, jQuery.hoverIntent.defaults, options);
   ...
};
jQuery.hoverIntent = {};
jQuery.extend(jQuery.hoverIntent, {
defaults: { sensitivity: 4, interval: 100 },
setDefaults: function(settings) {
jQuery.extend(jQuery.hoverIntent.defaults, settings);
 }
});

I hope that makes more sense.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery newbies?

2007-03-13 Thread Jörn Zaefferer
Nathan Young -X (natyoung - Artizen at Cisco) schrieb:
> I think knowing what "this" is and being able to use it appropriately is 
> pretty critical.
>
> I think never having given a flying *** about self and having no idea what it 
> is, is totally natural and not indicative of anything.
>   
Thanks all for your replies.

I agree that knowing about self isn't critical, but its also true that 
these are the details that an "expert" should know about. Thanks for 
enlightening me :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] [validation plugin] addError help!

2007-03-13 Thread Jörn Zaefferer
philguillard schrieb:
> I can't add and show an error message programmatically, seems to me that 
> addErrors function doesn’t exist in validation plugin 1.0 Beta 1
>
> But I found this in the docs :
> var validator = $("#myform").validate();
> validator.addErrors({"firstname": "I know that your firstname is Pete, 
> Pete!"});
> validator.showErrors();
>
> It seems a validator.showErrors({'id': 'the error'}); doesn't provide 
> the right information.
>
> Anybody can help?
>   
Just in case you didn't get my reply on the plugins list: Use showErrors 
instead of addErrors directly. I forgot to update the example, but fixed 
it in the latest revision. This should work:

var validator = $("#myform").validate();
validator.showErrors({"firstname": "I know that your firstname is Pete, 
Pete!"});

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] hoverIntent = my first plug-in

2007-03-13 Thread Jörn Zaefferer
Brandon Aaron schrieb:
> Very nice. I believe this will be getting a fair amount of usage!
>
>   
>> - ability to override default settings (sensitivity, polling interval, etc)
>> 
> This would be great and probably should be done by passing an options
> hash as the third argument. Usually options as passed as the first
> argument in plugins but it makes sense to be the third in this case.
>
> I would imagine it looking something like this:
>
> jQuery.fn.hoverIntent = function(f,g,o) {
> o = jQuery.extend({ sensitivity: 4, interval: 100 }, o || {});
> ...
> };
>   
How about this then...

jQuery.fn.hoverIntent = function (on,off,options) {
  var settings = jQuery.extend({}, jQuery.hoverIntent.defaults, options);
...
};
jQuery.hoverIntent = {};
jQuery.extend({ 
defaults: { sensitivity: 4, interval: 100 },
setDefaults: function(settings) {
jQuery.extend(jQuery.hoverIntent.defaults, settings);
}
});

I like that approach. Gives your users the chance to set defaults 
directly or more then one using setDefaults:

jQuery.hoverIntent.setDefaults({
interval: 250
});

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ANNOUNCE: The treemap plugin

2007-03-13 Thread Jörn Zaefferer
Renato Formato schrieb:
> Hi all,
>
> I wrote a jQuery plugin to show treemaps 
> (http://en.wikipedia.org/wiki/Treemap) easily thanks to jQuery.
>
> A treemap is a nice way to visually show data with rectangles and colors.
>
> Let me know what do you think about it, how can I enhance it, add new 
> features and so on.
>
> Link: http://www.jquery.info/spip.php?article40
>
> Please, be kind with my English, and, if it's wrong, tell me how to fix 
> it ;)
>   
I like that. Dunno yet what I'd need that for, but I'll keep it in mind. 
Could you please add the link to the plugin list in the wiki and provide 
demo links at the top of your plugin site? Thanks.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Calling all CF'ers... et al...

2007-03-13 Thread Jörn Zaefferer
Klaus Hartl schrieb:
> Yes, that is already useful! But it still depends on the form to be 
> submitted. Would be cool to have single fields validated on blur. That 
> would of course be useful for client-side validation as well. Maybe its 
> already implemented? I'm not uptodate with that.
>   
Currently you can specify one additional event for validation on each 
element.

I guess the combination of pure-client-side validation on keyup and 
submit with ajax-validation on blur would be the killer.

I'll investigate that.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Has anybody run into this?

2007-03-13 Thread Jörn Zaefferer
Sam Collett schrieb:
> Perhaps using the plugin after the page has loaded (rather than when
> it is ready) would be a workaround?
>
> i.e. instead of $(document).ready, use $(window).load
>   
That wouldn't hurt the validation.
> This link may help as well:
> http://code.jenseng.com/google/
>   
Thanks, will read that.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jQuery newbies?

2007-03-13 Thread Jörn Zaefferer
Hi folks,

the infamous ppk wrote in his blog:

"I've learnt one other trick for distinguishing newbies and pros: ask 
them the difference between |this| and |self|. Usually people who just 
claim to be excellent scripters don't know the answer, while real pros do."

So obviously I am not an excellent scripter, because I don't have any 
idea on the difference between those two. And I prefer discussing iton 
this instead of crawling through the ECMA spec.

Anyone?

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Reference to the element that triggered the event

2007-03-13 Thread Jörn Zaefferer
Aaron Heimlich schrieb:
> I believe e.target is what you're looking for
Agreed. jQuery provides a perfect target property just for you:

$(".selectable").click( function(e) {
   $(this).toggleClass("selected");
   $(e.target).toggleClass("clicked");
   saveCookie($(this).attr("id"), 
$(this).attr("class").indexOf("selected"));
  });

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Calling all CF'ers... et al...

2007-03-12 Thread Jörn Zaefferer
Klaus Hartl schrieb:
> Paul schrieb:
>   
>> What you described is basically what I do, Rick--not because Jorn's plugin
>> didn't work but because many of my form fields are validated against each
>> other, and database interaction is required to make that decision. (e.g.,
>> the validity of field Y depends on the value already entered in field X.)
>>
>> Below is the validate function I call onBlur from each input.  It first sets
>> the field's status icon to a loading spinny, then requests validation from a
>> CFM file, passing the value of the current field as well as the value of the
>> dependent criteria, which CF handles (cfswitch/cfcase) depending on which
>> field is passed.  The callback receives the response and shows either a
>> success or error icon with a descriptive error attached in a stylish little
>> error message balloon.
>>
>> I don't know if this is the smartest method--I'm pretty new to jQuery
>> myself--but it has worked very well and provides the flexibility I need.
>>
>> HTH,
>> Paul
>> 
>
> The good thing about such an approach is, that you have to implement 
> server-side validation anyway - client-side validation can never be more 
> than an addon to enhance user experience unless you can rely on 
> JavaScript being enabled. So why not reuse that logic client-side as 
> well for single fields. You improve the user experience while all logic 
> is still in place.
>   
One of the long-term targets of the validation plugin is to generate as 
much of the client-side validation rules as possible based on the 
serverside rules, without additional ajax requests.

Until that is available in any form, you could use the validation plugin 
to display your messages (returned from your AJAX request).

See this demo: 
http://jquery.bassistance.de/validate/demo-test/ajaxSubmit-intergration-demo.html

The relevant client code is this:

var v = $("#form").validate({
submitHandler: function(form) {
$(form).ajaxSubmit({
dataType: "json",
after: function(result) {
if(result.status) {
v.showErrors(result.data);
}   
}
});
}
});

In that example, result.data looks like this:

{'password': 'Your password is wrong (must be foobar).'}

That way you can use the same setup for displaying both clientside and 
serverside validation errors. Useful?

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Please add a basic debug function to the jQuery core...

2007-03-12 Thread Jörn Zaefferer
Daemach schrieb:
> I already have a plugin - it contains the code I put in my first email.  I
> just don't want to have to add that line or remember to remove it.  Adding
> the function directly to jquery will not affect the file size significantly
> and it will always be available.
>
> If I ever decide to switch to safari or opera (not bloody likely) I'll add a
> function that tests for the availability of a console.  Until then this
> works for me.
>   
You could modify jQuery's ant build and add that plugin for development 
builds of jQuery.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Why globalEval?

2007-03-12 Thread Jörn Zaefferer
Matt Kruse schrieb:
> I was just reading through some of the jQuery code again to better learn its
> internals, and I'm not sure why the globalEval function exists in its current
> form.
>
> Whenever I want to eval something in the global context, I always do:
>
>   Function(data)();
>
> since the Function constructor doesn't create a closure. This seems much
> simpler than the current logic, expecially for Safari - but I admit that I
> haven't done much cross-browser checking. Do some browsers not support the
> above syntax, or is there some other reason for using the long globalEval
> logic?
>   
I guess either that doesn't work cross-browser or noone came up with 
that solution so far. I haven't seen it, so odds aren't too bad it 
works. Good to know.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Has anybody run into this?

2007-03-12 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Hi, all..
>
> I've been working on Jorn's Validation plug-in and have just
> about got everything working perfectly for one particular form
> and I asked my wife to fill out the form and test the validation.
>
> She's got Google toolbar on her computer.  When the validation
> kicked in, instead of my messages showing above the form fields,
> Google's line of something like "Google toolbar can automatically
> fill in these fields for you...".  
>
> So now in that case Google's info was overriding my validation
> responses.
>
> Has anyone had to deal with that?  That's a big deal because everyone
> who has Google toolbar installed on their browser could have my
> validation overridden and not even be able to see problem entries
> or be able to submit a form.
>
> I guess one possible solution would be to use field names that
> they're not using like "Full_Name" instead of "Name"... this is only
> happening on the personal info, which Google toolbar can fill in.
>   
This was reported before, but I have so absolutely no clue how to 
prevent that. Taking non-obvious field names seems like a valid workaround.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] forms validation error divs - help

2007-03-12 Thread Jörn Zaefferer
amircx schrieb:
> i saw the api, but i dont get it, there are some duplicate label with
> diffrent error messages. i need one div to echo one error per field , and if
> the field got 2 errors then show the first error and if its fixed then show
> the secound  error...
>   
If you need more then one message per field, specify the messages via 
the plugin settings.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Anyone know how to do this?

2007-03-11 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Nevermind… I finally happened upon an example…
>   
I guess currently there is simply too much documentation, so its hard to 
find anything at all. I'll clean up the docs on the plugin page, until 
then, check the plugin API browser at 
http://jquery.bassistance.de/api-browser/plugins.html

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Why is this error occurring?

2007-03-11 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> D'oh!  I left out a line in the code... sigh ...
>   
Have you tried Komodo Edit to work on your JavaScript? Its the only 
editor that provides syntax checking that I know of, could be a great help.

http://activestate.com/products/komodo_edit/

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Validation help with Date Selector

2007-03-11 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> onInvalid: function(form) {
> $(form).find("[EMAIL PROTECTED]").attr("disabled", "disabled");
> },
> onValid: function(form) {
> $(form).find("[EMAIL PROTECTED]").attr("disabled", "");
> }
>
>
>
> That looks good to me!  Hopefully that will work.  I'm using Jorn's plug-in
> in debug mode, which is supposed to prevent submission whether the
> form fields are correct or not.  However, since I'm using other script which
> works in an Ajax manner to submit the entries to another page, I think
> that's
> interfering somewhat with Jorn's plug-in and its control over the process.
>
> I'll tinker around with your methods above and see what happens.
>
> Hopefully, Jorn will show up and provide us some assistance, too...
>   
See the other thread. Just write your own submitHandler, that way you 
don't need to disable anything.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How can I disable a form submit button if there are entry errors?

2007-03-11 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Also... to Jorn... Jorn, do you know how I can
> disable a submit button while errors are present in a
> form using your validation plug-in, then have the
> submit button re-enabled once the form entries
> are error-free?
You need to think the other-way round. Just disable your "default 
behaviour" as long as the form is invalid.

The validation plugin provides a submitHandler callback. Put your 
calculation/ajax request inside of that, and it is only executed when 
the form is valid.

Something like this:
$(...).validate({
...,
submitHandler: function() {
   // send AJAX request for calculation
}
});

So in your case, move the stuff that gets executed when you click the 
submit button into the submit handler, and remove the click event entirely.

The form will never be submitted when you provide a submitHandler.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Accordion - onHide / onShow actions available ?!?!

2007-03-11 Thread Jörn Zaefferer
Cees (**snow**) schrieb:
> The puropse of the .change is to catch the click of an element when the
> accordion moves in (all items can be hidden (alwaysOpen=false)) and the
> class stays selected but shoud revert to notSelected. 
>   
The change callback gets five argument in total. The first argument is a 
default event object, the others refer to the new and old title and 
content elements (see the example). So you can just refer to these 
arguments instead of searching for the elements on your own. That should 
be much easier.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Options for Validation...

2007-03-09 Thread Jörn Zaefferer
Sam Collett schrieb:
> Didn't realise that - I thought they were just DOM elements. The CSS
> should still be interpreted even if the error label is not originally
> on the page.
>
> Using insert before would mean the text input shifts when the error
> shows (i.e. moves right), but with CSS you could style it so this
> doesn't happen.
>   
Good point, I didn't consider that.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need some guidance...

2007-03-09 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> I’m finding it nearly impossible to get the
> positioning of the error message relative to the form field.
>
> It looks like that's because they are both linked by being
> lumped together in the class "error".
>
> I think I could get what I'm after if I could address the
> error message and invalid elements separately, as in
> error.message and error.element or whatever.
>
> Is there a way separately style the message and the element?
>   
I don't quite see the problem:

label.error { styles for error messages }
input.error { styles for invalid fields }

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Wich element triggered an event?

2007-03-09 Thread Jörn Zaefferer
Abel Tamayo schrieb:
> Hi all. I'd like to know if there's a standard, easy way to determine 
> with element triggered an event. I'm pretty sure there is, but can't 
> find it in google. Maybe an atribute in the e parameter received by 
> the function like:
>
> $("p").bind(
>   "click",
>   function(e){
> console.log(e.TRIGGER); // This trigger attribute of the element e 
> is the one that started the action.
>   }
> );
Inside the event handler, the "this"-keyword refers to the element that 
handles the event, while the "target" property of the event object 
refers to the element that triggered the event.

$("p").click(function(event) {
alert(this) // <- always refers to a paragraph
alert(event.target) // <- refers to a paragraph or any child of it
});

You can use the target property to implement a event delegation (instead 
of event handling). A plugin that uses that: 
http://bassistance.de/jquery-plugins/jquery-plugin-accordion/

Of course it has its drawbacks, as discovered recently, see the comments 
at the end of that page.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Options for Validation...

2007-03-09 Thread Jörn Zaefferer
Sam Collett schrieb:
> You could probably use CSS for that, but before you do, errorPlacement
> needs to change (i.e. don't add the )
>
> errorPlacement: function(error, element) {
>$(element).before(error);
> },
>
> And your CSS:
>
> label.error {
>   position: relative;
>   margin-top: -1em;
> }
>
> The problem with that is that it may obstruct some text or an input
> above (without seeing how your page looks, there is no way to know).
Sam, keep in mind that the element is already inside the document, but 
the error label is not. And both are jQuery objects, so this should work:

errorPlacement: function(error, element) {
    error.insertBefore(element);
}

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] One element, multiple actions

2007-03-09 Thread Jörn Zaefferer
Rob Wilkerson schrieb:
> Ah, that's what I was looking for.  I knew about jQuery's
> "chainability", but being more familiar with the Java world, I'm not
> used to chaining completely unrelated actions.  That's really cool.
>   
Maybe it helps to see how the jQuery would look like when implemented in 
Java: http://bassistance.de/2007/02/26/how-would-jquery-look-like-in-java/

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] New plugin: ContextMenu

2007-03-09 Thread Jörn Zaefferer
Chris Domigan schrieb:
> Hi everyone
>
> The first version of my new ContextMenu plugin has been released. You 
> can grab it here:
>
> http://www.trendskitchens.co.nz/jquery/contextmenu/ 
> <http://www.trendskitchens.co.nz/jquery/contextmenu/>
>
> ContextMenu lets you selectively replace the browser's right click 
> menu with one of your own. It is fully customisable and allows you to 
> bind context-sensitive actions to each menu option.
>
> Big thanks to Joern Zaefferer whose excellent Tooltip plugin provided 
> much inspiration.
>
> This is my first plugin for jQuery and any 
> feedback/comments/improvements would be most appreciated!
Great job!

Seems like you didn't like the Tooltip approach of prividing only the 
very basics of inline-styles and the rest via stylesheets.

You could move both hiding of the menu on page load (doesn't work 
without JS) and most of the formatting styles into a stylesheet, I'd 
prefer that solution.

It's difficult to override the default inline-styles from a stylesheet, 
and I like to keep that seperated.

I'm curious about more features to come, and will keep this in mind to 
use it on the first possible occasion.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need help placing validation message...

2007-03-09 Thread Jörn Zaefferer
Rick Faircloth schrieb:
>
> errorPlacement: function(error, #Principal) {
>
> error.insertBefore(#Principal);
>
> },
>
That doesn't make much sense. I guess this would be more productive if 
you would concentrate on what you want to achieve, and give me an html 
mockup of that.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need some guidance...

2007-03-09 Thread Jörn Zaefferer
Rick Faircloth schrieb:
>> All formatting should be done via external stylesheets. The plugin lets 
>> you customize the class used to mark them as "error labels", but that's
>> it.
>> 
> What is the "class used to mark them as 'error labels'"?
> Is that a class that I assign to them for the stylesheets to rference?
By default, both invalid elements and their error label get a class 
"error". You can just style the element with that class, or customize 
the error class via the errorClass option.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Problem with validation

2007-03-08 Thread Jörn Zaefferer
Leonardo K schrieb:
> Can I suggest something?
>
> Instead of making for example:
>
> messages:{
> fieldName: {
> required: "blabla"
> }
> }
>
> To use a standard for all the messages:
>
> messages:{
> required: "blabla"
> }
You can override default messages by modifying the 
jQuery.validator.messages object. So in your case:
jQuery.validator.messages.required = "blablabla"

That then applies to all validations following.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Problem with validation

2007-03-08 Thread Jörn Zaefferer
Leonardo K schrieb:
> Your code don't solve my problem, but I believe that I found the problem.
>
> The problem is the label class. When I set the errorClass, the label 
> still have the class='error'.
>
> $("form").validate({
> focusInvalid: false,
> event: "blur",
> debug: true,
> errorClass: "comErro",
> errorPlacement: function(error, id) {
> error.attr("class", "comErro");
>   error.appendTo( element.next() );
> }
> });
That is a bug, thanks for spotting it.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Options for Validation...

2007-03-08 Thread Jörn Zaefferer
Rick Faircloth schrieb:
>
> Calling all jQuery/CF’ers…
>
> I’m not real satisfied with the error message placement
>
> options in Jorn Zaefferer’s validation plug-in.
>
> I like to place my error messages right above the form field
>
> that the error message references.
>
> Right now, as I understand it, Jorn’s plug-in doesn’t allow
>
> for that type of placement.
>
Forgot that other message. Well, parts of it. You can customize the 
error placement!

Just implement the errorPlacement function:

$("#myform").validate({
errorPlacement: function(error, element) {
// do whatever you like with error and the element, eg.:
error.insertBefore(element); // <- inserts the error before the element, 
use next() or prev() or parent() on element etc. to navigate through the DOM
}
});

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need some guidance...

2007-03-08 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Well, Jorn... I finally figured out the problem...
>
> I hadn't assigned an id's to my form fields (Principal, Interest, Years),
> so I couldn't see the conflict.
>
> However, it looks like id's were automatically being assigned to my
> form fields when published... they were renamed using the form id
> and then the field name attached, as in
> "#Mortgage_Calculation_FormPrincipal"
> and I guess this id was confusing the validation plug-in (although I'm not
> quite sure why because even though the automatically generated id name
> included the form id name, it was not the same name exactly.
>   
The plugin genereates IDs by combining the form's id with the element's 
name. Of course that doesn't happen when element already have IDs. Can 
you tell me what combination of IDs and names caused the "confusion"? 
I'd like to fix that.
> However, the lesson learned:  Always assign id's (unique ones) to every
> element.
>
> So I've got the plug-in working.
>
> Now I've got two more questions:
>
> 1)  How do I format the validation message?  In the plug-in settings?  Can I
> put CSS formatting in there?
>   
All formatting should be done via external stylesheets. The plugin lets 
you customize the class used to mark them as "error labels", but thats it.
> 2) How can I get the messages to display above the form fields? Can the
> label tag take CSS formatting in-line?
>   
You can use the errorPlacement option to take the placement of the 
labels in your own hand. So you could append them to the body element 
and add absolute positioning.

Beware that the example of the errorPlacement option is flawed. The 
second argument is not the ID, but the element itself as a jQuery 
object. The documentation for the option itself is correct.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Custome selectors use : as seperator, which is an official character for id's

2007-03-08 Thread Jörn Zaefferer
Brandon Aaron schrieb:
> There is a ticket for this: http://dev.jquery.com/ticket/143
>   
I've added another comment on that ticket.

I'm currently working with JSF, too, so a working solution is quite 
interesting.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] release: Validation plugin beta 1

2007-03-08 Thread Jörn Zaefferer
Brice Burgess schrieb:
> Jörn Zaefferer wrote:
>   
>> Actually I was referring to the use of metadata ;-)
>>
>> The metadata plugin was the result of a pretty long discussion about the 
>> best approach on metadata, a lot of brainpower went into that one :-)
>>
>>   
>> 
> Any chance on integrating this into the core API? I think it would be 
> pretty cool. I know a lot of plugins use, or will be using the metadata 
> plugin.
>
> The same two functions could be used, but I'd like $.data() to be able 
> to override the default extraction method set with $.meta().
>
> Something like;
>
> jQuery.meta('set default extraction to element's attribute || 
> selector referencing script '),
> jQueryObject.data() // grab the data
> jQurryObject.data('override default extraxtion'); // grab the data 
> using a non-default extractor
>   
A little background on the inner workings of the metadata plugin: It 
extracts the metadata on first access of the element via jQuery, 
therefore it is already available when calling data(). Therefore your 
proposal would be not so very easy to implement.

And as jQuery is growing with its bug fixes, even without any new core 
features, I don't expect to see any new features in jQuery core at all 
in the next months. More effort will go into leverarging the qualitity 
of plugins to the level of the core.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need help implementing validation...

2007-03-08 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Well now I'm getting somewhere...
>
> What was happening is that all the form fields (Principal, Interest, Years)
> in the MC_Form did not have id's assigned to them by me.
>
> However, when rendered, the fields were being automatically assigned
> an id such #MC_FormPrincipal or #MC_FormInterest.  (From the looks of
> the Firebug response that's why I think was happening, anyway.)
>
> Once I assigned explicit id's to each of the form fields, I began to get
> a response from the validation plug-in.
>
> Whew!  Man that has been driving me crazy all week!
>   
Well, good news at last, good to hear.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need help implementing validation...

2007-03-07 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Thanks for looking at it, Jorn...
>
> It's still not working.  I checked the version of the validation plugin
> and Firebug tells me it's beta 1.
>
> However, I downloaded the validation plug-in again and also jquery
> just to make sure.
>
> I added the id to the form.
>
> Still having no luck.  :o(
>
> Any other ideas?
>   
Yes. You've got a second element with the same ID as your form.

Get Firebug and execute this on the console to see the element: 
$("#Mortgage_Calculation_Form")

You really need to test your selectors until you are absolutely sure 
that you are selecting the right element before doing anything with the 
element.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Best practices for reattaching behaviours todynamically loaded content?

2007-03-07 Thread Jörn Zaefferer
Jonathan Sharp schrieb:
> Here's another thought too...
>  
> What about having a plugin export a custom event, then when dynamic 
> content is loaded that uses that plugin it just triggers that event.
>  
> For example:
>  
> // jquery.myPlugin.js
> $(window).bind('myPluginReload', function() {
> $("find stuff").myPlugin({do: "things"});
> });
>  
> // Content being returned via AJAX
> $(window).trigger('myPluginReload');
You could pass the changed element as additional arguments to the event, 
so you just update those, something like this:

// jquery.myPlugin.js
$(window).bind('myPluginReload', function(event, changedElement) {
$("find stuff", changedElement).myPlugin({do: "things"});
});
 
// Content being returned via AJAX
$(window).trigger('myPluginReload', changedElement);

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need help implementing validation...

2007-03-07 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Hi, Jorn and thanks for the reply...
>
> You can see what I'm trying to do by going to
> http://bodaford.whitestonemedia.com/html/featured_property_details.cfm?Prope
> rty_ID=1
>
> Scroll down and click on the "Click here to calculate mortgage payment" and
> the
> form fields and button should slide into view.
>   
As I said, an example does can do wonders.

First, you still have alpha 2 on that page.

Second, and more important, your form selector doesn't select anything. 
Just try it by feeding this to the Firebug console on your page: 
$("#Mortgage_Calculation_Form")

Your form has a name, but no ID.

The fact that it worked at some point could have been caused by a bug in 
jQuery core itself, which was fixed recently.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Anybody able to successfully run Validation plugin on IE 7?

2007-03-07 Thread Jörn Zaefferer
Rick Faircloth schrieb:
>
> Hi, all…
>
> I’ve been trying to get Jorn’s (bassistance.de) Validation plugin
>
> working correctly for 3 days now… Firebug
>
> doesn’t complain of any errors.
>
> The new beta 1 doesn’t work for me in FF or IE.
>
> Jorn’s examples run fine. But there don’t seem
>
> to be any errors in my code.
>
> Anybody using it successfully?
>
When you use Firebug to debug the validation, try starting with a 
breakpoint in the validator's form method (around line 350). Skip over 
the loop at first and inspect "this": Check the errorList property: Is 
it empty? Then the validator didn't find any validation rules or it 
didn't find any invalid elements. Check the "element" property: Empty? 
No elements found in the form (very unlikely).
If that doesn't help, reload the page, and run the validation again. Go 
into each call of check(element). Stop after the line calling rules(). 
The local variable "rules" should now contain the rules found for the 
current element. If it is empty, there are either no rules defined for 
that object, or something went wrong.

I spent a lot of time refactoring the validator's code, I hope it is 
readable enough so you don't get totally lost while debugging.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] release: Validation plugin beta 1

2007-03-07 Thread Jörn Zaefferer
Fil schrieb:
>> Since jQuery 1.1.2, there are no more browser
>> issues with that format. Whether you use it or not is your choice, the
>> recommended alternative is settings validation rules via plugin options.
>> 
>
> I *will* use it, that's why I asked these questions :)  Glad to see
> they have already been thought through.
>   
Actually I was referring to the use of metadata ;-)

The metadata plugin was the result of a pretty long discussion about the 
best approach on metadata, a lot of brainpower went into that one :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] release: Validation plugin beta 1

2007-03-07 Thread Jörn Zaefferer
amircx schrieb:
> is anyone here tried to run this code on ie6 ? i wonder if its just my
> browser or the versions of the files are incorrect
>   
I'm testing the plugin in Firefox 2, IE6 & 7 and Opera 9.1. Apart from 
the issues reported on the plugin page, I never experienced any 
problems. And the known issues are easy to avoid.

I read about different versions of IE6 causing problems on this list, 
maybe you have on of those versions. Maybe posting your version number 
of trying to get updates helps.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] release: Validation plugin beta 1

2007-03-07 Thread Jörn Zaefferer
Fil schrieb:
>> http://bassistance.de/jquery-plugins/jquery-plugin-validation/
>> 
>
> Oh it's great.
>
> I wonder though if your choice of writing class="{x:y;z:t}" is not
> potentially problematic.
>
> As I see it:
> - it could be incompatible with CSS2.1 selectors
> - it is probably incompatible with jQuery selectors
> - it is *certainly* going to confuse a few users
> - it might confuse some browsers (though I guess you've tested this)
>
> An alternative would be to write something like
> class="DEF-x-y_z-t"
>
> (but I admit it's much uglier)   :)
>   
Hey Fil,

thanks for worrying about that, but it was discussed in detail for the 
first time more then half a year ago, and kind of standarized by John 
with his metadata plugin. Since jQuery 1.1.2, there are no more browser 
issues with that format. Whether you use it or not is your choice, the 
recommended alternative is settings validation rules via plugin options.

The curly braces are illegal characters for a CSS selector, so there is 
no way to confuse those classes with style classes.

The not-so-very-obvious flaw, as pointed out by Andrea, is something 
like this: class="{required:'#some element andAnother'}".
That procudes a valid style class "element".

I keep support for the metadata because I can imagine that it is much 
easier for a serverside generated form to add additional classes to each 
element instead of composing the necessary JavaScript in a seperate 
script tag.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] release: Validation plugin beta 1

2007-03-07 Thread Jörn Zaefferer
Paul Bakaus schrieb:
> Hi Jörn,
>
> just a minor issue:
> The text "Please accept our policy" after clicking submit on the 
> second form will not vanish directly after checking the checkbox.
> Other than that, great work!
Good point. A click of course isn't a keyup, so that doesn't work. Again 
you could build a workaround for that particular field:

var validator = $("#myform").validate({
event: "keyup"
});
$("#agree").click(function() {
validator.element(this);
});

I'll think about how that can be streamlined in the plugin. Any ideas 
are welcome.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] release: Validation plugin beta 1

2007-03-07 Thread Jörn Zaefferer
Stefan Kilp [sk-software] schrieb:
> Hi,
>
> testing demoform "validating a complete from"
>
> i entered 123456 in password field, then entered 11 in confirm password
> which leads to a warning "please enter the same password as above" which is 
> correct.
> now i enter 11 in password field. so both inputs match each other. but 
> the warning after 
> confirm password is still visible (but should be removed)
>   
The message is removed the moment you submit the form (just press enter 
after editing the password field again). So far I don't consider this a 
bug. A workaround is still possible: Add a custom keyup event to the 
password field and programmatically validate the the confirm password 
field, something like this:

var validator = $("#myform").validate();
$("#password").keyup(function() {
validator.element("#confirm_password");
});
> - what about putting a version number in the demo test site
>   
Normally I update the demo test site when uploading a new release, so 
you can always refer to the plugin page for versions. I see if I can 
automate that.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Problem with validation

2007-03-07 Thread Jörn Zaefferer
Leonardo K schrieb:
> Whenever plugin validates the field it creates new label with error
I forgot to update the example about errorPlacement, d'oh. Try this:

errorPlacement: function(error, element) {
error.appendTo( element.next() );
}

I tried your example here, and it works.

If the above doesn't solve your issue, could you post an example page?

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need help implementing validation...

2007-03-07 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Strange thing is that your demo's are working in
> IE 7 and FF, too.
>
> But neither for me.  It must be my code...
>   
Sorry for the confusion, my fault about the not-updated download-label, 
I fixed that.

Of course that doesn't make your code working. Could you post an example 
page of your setup? That greatly helps helping you :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need some guidance...

2007-03-07 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Hmmm… can’t get any reaction from the validation code.
>
> Here’s my script and html… what’s wrong with it?
> (I’ve included my show/hide script and my CalculateMortgage
> script in case there’s a conflict)
>
> The Mortgage Calculation still runs fine, but when I submit the
> form without an entry I get a CF error stating that the expression
> that calculates the payment can’t be evaluated.
>
> Isn’t the validation code supposed to prevent submission when
> a form field is blank?  And in this case, with debug on, it should
> stop all submissions?
>
> But, it's pretty much like the validation code is not even active.
> I don't get any kind of response from it.
>   
I can't find any hint of an issue in your code, so I suspect the problem 
lies in my plugin.

I hope you can be patient enough to wait for beta 1. I've implemented 
all features, and just need to do a little bit more testing.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] treeview problem

2007-03-06 Thread Jörn Zaefferer
Denis schrieb:
> Hi,
> here http://jquery.bassistance.de/treeview/ i found tree example, but it 
> didn't work when I wrap this example with my DIV's,
> any ideas how to prevent it ?
>   
A few more details would help to help you.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need help implementing validation...

2007-03-06 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Thanks for responding, Josh.
>
> I know it's a lot of code, but I figured the problem might
> be related to the other code.
>
> How about this part, does it look correct?
> I haven't been using Firebug, but I'll check into it, too.
>   
Hey Rick,

I've just released beta 1 of the validation plugin. Odds are good that 
it solves your bug :-)

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] release: Validation plugin beta 1

2007-03-06 Thread Jörn Zaefferer
Hi folks,

just released beta 1 of my validation plugin. The list of problem was 
reduced quite a lot, and currently I have no more outstanding feature 
requests.

Most notable new features:
 - dependency checking: The required method accepts both 
jQuery-expressions and functions to compute whether a field is required 
or not
 - customizing error message handling: From doing it all yourself (and 
still delegating to the default handler) to customizing the placement of 
generated error messages

As usual, the updated plugin page: 
http://bassistance.de/jquery-plugins/jquery-plugin-validation/

And considering the rather unfriendly format of the API docs, I uploaded 
a standalone version of my API browser that features my five plugins: 
http://jquery.bassistance.de/api-browser/plugins.html
Among the rest it contains the essential validate()-method: 
http://jquery.bassistance.de/api-browser/plugins.html#validateMap

I've also update the demos: http://jquery.bassistance.de/validate/demo-test/

I'd like to delay all further feature requests to post-1.0, now 
concentrating on squishing all remaining issues, any help is appreciated.

Have fun!

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Need some guidance...

2007-03-05 Thread Jörn Zaefferer
Rick Faircloth schrieb:
> Principal:  Validate for entry / Validate that entry is numerical after $ ,
> . are all stripped from entry.
> Interest:  Validate for entry / Validate that entry is numerical
> Years:  Validate for entry / Validate that entry is numerical
>
> There are so many examples on
> http://bassistance.de/jquery-plugins/jquery-plugin-validation
> that I'm not sure which one is most appropriate.  I usually use RegEx to
> validate the principal entry, too.
>   
Princial: Required Add your own validation method, using the mentioned 
regex. Something like this:
$.validator.addMethod("numeric", function(value) {
return /myregex/.test(value);
});

Interest: required + number
Years: required + number

Watch out for the beta 1 release, that improves a lot of things. I see 
if I can get to improve the method examples too.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Conditional validation - validator plugin.

2007-03-05 Thread Jörn Zaefferer
Web Specialist schrieb:
> Daemach,
>
> Wait for the next release for Jorn's Form Validation plugin. Could be 
> a conditional validation to help us, yeahhh Jorn??? ;-)
That is already implemented, and will be available as soon as I release 
beta 1. And that should be the case in a few days at most.

About the function-in-metadata-problem: Don't to that, just define that 
function in plain JavaScript. I've got an example that shows how it 
should/could be done.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How Do i Assign error div to JQuery Validator Plugin Alpha 2 ?

2007-03-05 Thread Jörn Zaefferer
amircx schrieb:
> i tried hours to figure out what i did worng... i didnt find out how to do
> it
> is that possible?
> ill be glad if you tell me how to do it
>   
Take the parameters out of the submitHandler. Just look at the example 
where you copied it from. It should be something like this:

$(...).validate({

submitHandler: function() {
   ...
},

rules: {
   ...
},

messages: {
   ...
}

});

And about your other problem: Just modify your form to look like this:

  
  password
  
please enter password


  firstname
  
Please fill the name!

  


Just use label elements and their for-attributes to assiociate the error 
messages with the input fields.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Of extendos, metadata and valid XHMTL - Is it ok to add attributes to elements?

2007-03-05 Thread Jörn Zaefferer
Daemach schrieb:
> Thanks for the info on the metadata plugin.
>
> "Make sure to avoid any spaces..." is exactly the kind of "gotcha" that
> makes using classes as a data repository so troublesome.  While it is
> technically possible, mixing data types inside an attribute just feels like
> a bad practice to me.
>   
Sure thing. The validation plugin offers metadata as an option, and 
doesn't rely on it at all. So it is up to the user to decide what works 
best for him.

Though since the first release of the validation plugin my opinions 
about metadata changed quite a lot. Currently I'd recommend to put any 
validation rules completely in JavaScript.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Of extendos, metadata and valid XHMTL - Is it ok to add attributes to elements?

2007-03-04 Thread Jörn Zaefferer
Daemach schrieb:
> Actually I think I may just modify the validator code to read out of a custom
> expando.  It would be nice to be able to pass the attribute name to the
> validator engine directly though...
>
> Jorn?  <==(sorry - I don't know how to do the fancy "o" ;)
>   
Heh, . Just copy&paste the next time you need it ;)

Actually the custom attribute is already supported: Just tell the 
metadata plugin to do so, and the validator uses it.

Put this in front of any other code that uses the metadata (eg. validation):
$.meta.setType("attr", "validate")
And replace "validate" with anything you like as a custom attribute.

In case you need to use the classes, make sure to avoid any spaces, eg. 
class="{require:true,email:true}" can't be confused by any browser with 
any actual style class, because the curly braces are illegal characters 
for style classes.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Packing script

2007-03-04 Thread Jörn Zaefferer
Ámon Tamás schrieb:
> Hello,
>
> Maybe off, sorry.
>
> I made a little script, and I like to pack it. I try to use the js.jar 
> what is in the svn version of jquery. I try with the next command:
>
> java -jar ./build/js.jar ./build/build/pack.js szamolo.js  ./szamolo.pack.js
>
> But, when I like to use the szamolo.pack.js instead of szamolo.js I get 
> the following error:
>
> missing ; before statement
>
> Before packing, I put semicolon after every line.
>
> How can I pack my script?
>   
There was a bug in the build files in svn. Make sure to get the latest 
version so you don't have that.

Otherwise: Check your code again. There problem maybe not as obivous. 
Look for something like this:
var bla = function() {
    // stuff
} <- missing semicolon
// other stuff

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How Do i Assign error div to JQuery Validator Plugin Alpha 2 ?

2007-03-04 Thread Jörn Zaefferer
amircx schrieb:
> hey, i got the following code (i fixed the ie6 bugs and stuff)
>
>
> now i need to figure out how can i assign the div the shows errors in each
> input? i saw the demos but the problem is that i want to control on each div
> position with my css.. .is that possible ? or anyone can shows me how to do
> it in diffrent way that i will able to control the positions on each error
> div?
>   
That is the last feature that I'm going to implement in 1.0. I'll 
release the first beta once that is in, please be patient until then :-)

Regards

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jquery accordion plugin settings help

2007-02-28 Thread Jörn Zaefferer
schnuck schrieb:
> but it causes exactly the same problem as the one you suggested: the smooth
> hiding animation gets lost. a click on another panel simply closes the open
> panel immediately and slide opens the new panel. the whole closing animation
> sequence is supressed. anyone knows why?
>   
The hidespeed is measured in milliseconds, using the same units as 
jQuerys built-in animations. So the smaller the value, the faster the 
animation. Try to simply increase the value, that should give you a 
smooth animation.

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Q: best way to create dynamic content?

2007-02-28 Thread Jörn Zaefferer
nrwsteff schrieb:
> so jörn, if you can release your plugin it would be perfect and i will 
> give it a try.
Here we go: http://bassistance.de/jquery-plugins/jquery-plugin-format/

You are basically the first user, so any feedback is highly appreciated!

-- 
Jörn Zaefferer

http://bassistance.de


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


  1   2   3   4   5   6   7   8   9   10   >