Hooray!
That's it sorted. Thanks again Karl :)
Hey Karl,
That's probably exactly why! I wasn't aware I needed to do this - so I
will organise that now.
Many thanks,
Dave
Just heard from someone who found me on Google, but the plugin list
was not mentioned...
I've had two of my jQuery plugins published for a while now (more than
a year) on teh jQuery site, with backup doumentation and demoes on my
own site.
http://plugins.jquery.com/project/form-highlight
http://plugins.jquery.com/project/Populate
However - they don't appear to show up in the plugins
Hi Everyone,
I've recently updated my "Highlight" plugin, which is designed to
increases usability by highlighting elements as you interact with the
page. Its primary use is for forms, but it can also be used for
tables, lists, or any element you specify.
Examples uses:
* Form-filling can b
Hi Everyone,
I've finally updated my Populate plugin, which populates a form using
JSON data.
This plugin supports full PHP hierarchical naming and deep JSON data
structures, as well as checkbox arrays and other non-standard UI
controls. The plugin can be used as part of your AJAX toolkit, or fo
I love validate. It takes a bit of getting used to the options, but
it's great.
I attach a custom attribute to any items i want validated with simple
rules, then validate does the rest.
A rough example:
Any error messages will go here...
$('#form-1').validate()
You don't need a plugin, just the animate effect:
$('page').animate({left:600}, 1000)
> I was also thinking that the routine you built could be converted into
a search-term highlighter.
There's already a jQuery plugin that highlights, called, conveniently-
enough, highlight!
:)
Yup - you need jQuery and Regular Expressions:
var elements = $('a[class="tablink"]')
elements.each(
function(){
var html = $(this).html()
html = html.replace(/([A-Z])/g, '$1')
$(this).html(html)
}
)
; wrote:
> Dave, That is great! Thanks.
> I've tested it out with an array of 1000 names as a worst case
> scenario and it is pretty slow. I'll have to see about refining the
> list of names if possible to keep it as small as possible.
>
> Thanks again,
> Stephen
&g
Hey Stephen,
RegExps are always going to be slower than a basic indexOf, so perhaps
when you loop through the names you could try running an indexOf
first, then if it comes out positive, only then do you the RegExp
replacement.
I imagine that there would be a cutoff point where the performance
in
Heh heh, this is cool!
var names = ['Stephen Boyd','Fred Von Brown']
$("body").each(
function(){
var html = $(this).html()
$(names).each(
function(i, e){
var rx= new RegExp(e, 'gi')
html = html.replace(rx, '' +e+ '')
}
For only the first name on each page, just remove the 'g' modifier
from the RegExp constructor (I'm sure you know this)
How funny - I wrote the exact same thing tonight!
http://www.keyframesandcode.com/code/development/javascript/jquery-favelet/
Well you could do something like this (it would be prohibitively slow
on 250 names on one page though!!) :
var names = ['Stephen','Fred']
$("body").each(
function(){
var html = $(this).html()
$(names).each(
function(i, e){
var rx= new RegExp(e, 'gi')
> it looks like he is trying to find td elements with an id that *starts* with
> "order,"
True!
But the jquery was good. So not sure what was going on there.
Sometimes you just need to delete blocks of code and write from
scratch, as you just can't what's not quite right (the brain sees what
it
Not sure, but from an id/class point of view, any page id should be
unique, so your "order" identifier if it is to be used on many TDs,
should really be a class="order".
So if you're just picking up a single id, there's no need to iterate
over, is there?
Anyway - I replicated your test and find w
Well regexp would be useful if there was a pattern to people's names,
but there isn't.
Do you want to find any names, or a list, or a specific name?
Sorry - text got cut off:
Doing it the old way:
window.onbeforeunload = function(){
return "Are you sure?"
}
Worked great.
Well you know - try as I like, I could NOT get the DOM method
addEventListener to work for beforeunload.
Doing it the old way:
window.onbeforeunload = function(){
return "Are you sure?"
}
I couldn't bind 'beforeunload' to the window. document, or body tag
successfully.
I had to revert to a manual 'window.beforeunload'. I know I should be
doing something like
evt = window.attachEvent ? window.attachEvent('onbeforeunload', fn) :
window.addEventListener('beforeunload', fn, false)
b
Yes!
The CSS background image is the way forward.
Thank [EMAIL PROTECTED] for that. A layered-over-the-top-div solution would have
been a complete and horrible hack as far as I'm concerned, so this is
just great.
li.thumbnail{
position:relative;
width:75px;
height:75px;
Brainwave: CSS background-image!
I'm going to try this now...
"[EMAIL PROTECTED] Macs as usual!" was my first thought.
But I'm borrowing a Mac laptop to try and check stuff out over the
next few days, so I'll try and keep this thread current and will let
you know
Dave
Hi all,
I'm developing a back end for a photographer's agent, and she wants
the site to be mainly drag 'n' drop thumbnail images, so she can
create "collections" of various images, by dragging from various bins.
So I've started with a styled list of images, and each
contains an .
Each aligns t
I knew about :input, but my brain just pre-supposed it meant only
input elements so I had kind of disregarded them somewhat.
So thanks for pointing that out!
Hey Marty,
I couldn't live without PHP's square brackets. I just about always
want to split up a form into component parts.
I could easily write something using RegExp to do this for me, but
having it all built in is just lovely.
Great that Rails has it too.
Cheers,
Dave
Hi Aaron,
Good styles there with the name attribute stuff. Not so good if you
want to grab other entities such as selects, but good to see that it
accepts non-standard characters.
OK - this is the best I could come up:
function $$(selector, context){
return jQuery(selector.replace(/(\[|\])/g, '\\$1'),
context)
}
$$('#contact[email]')
It adds to the global namespace (so won't work with prototype for
example, which also uses
Wow, that's really useful to know, thanks Karl.
I think I'll just use a regular expression:
selector = selector.replace(/(\[|\])/g, '\$1')
It would be really useful if this were an option, somehow. My jQuery-
foo is not all that.
Any ideas, anyone?
Cheers,
Dave
tors e.g.
#contact #email
offer different advantages. Has anyone any preferences, and why??
Many thanks,
Dave Stewart
Hi Jorn,
Sorry for teh delay - was ill yesterday so took a day off.
Well it looks like you've made some amendments to the code, so I don't
think I can reproduce the steps now, but, this is what *did* happen:
1 - new page, no email or password
2 - click "Email my password"
- Email validati
Hey Jorn,
Actually the main form image are part of the Art and Science of CSS
book (hell, they published it, so I guess you can) but you could just
specify no bg image and have coloured blocks instead.
The highlight code is mine, but I've updated the first line to cleaner
jQuery to read
Jorn,
I've done some work on selectors for groups, and it's actually quite
easy to select a group or sub group for validation, although I don't
know the details of your implementation, so I wont suppose to imply
anything.
As usual I've uploaded some demo code for you to take a look.
www.
f the submission fails on any other element all ignored elements are
restored and the form is one again bullet-proof, ready for another
submission.
What do you think?
Cheers,
Dave
On Feb 1, 10:53 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Dave Stewart schrieb
Jorn,
Here is a live example.
http://www.janepatrick.co.uk/admin/test/associative.php
Hopefully it's in your interest to examine this issue further!
Many thanks,
dave
Hey Jorn,
That's great! As you know I'm a big fan of the plugin :)
You know I've written a whole load of cool helper stuff that works
with validate. Perhaps I should email you, rather than using this
agonisingly slow groups thing...? Let me know if that's cool.
Did you see my other post about va
Hi Jorn,
Yup - here's a test page:
http://www.janepatrick.co.uk/admin/test/login.php
Submitting the form manually (as you said) just bypasses any
validation, which is NOT what I want, as I still need the email
address validated before it's sent to the back end to email the
password...
U
$("#scrollStats").html('bold');
$("#scrollStats").text('text');
Hi there
I'm building a login form, with a "Forgot password" link. When
clicked, I need to unset some validation options to successfully
submit the form.
The code I'm running does this:
1 - remove the validation constraints from the password field
2 - hide any error messages that
Thanks David and Tim,
I didn't know that. Very useful.
Hi Chris,
The trick to Google Maps (for me at least) was getting to know the
basics of the OOPness of it all.
EVERYTHING (just about) is an object. You rarely pass values, you
normally instantiate objects, then pass them.
For example, in the example Bohdan gave, you would have to 1) create
the
I made a small discovery (in my sleep no less!) that works in HTML,
but screws up the PHP:
HTML:
If I put the array properties in single quotes (the spaces are to make
it clearer), the controls are validated as a group! This is good.
PHP:
However, the PHP also receives those single quotes, so
Hey folks,
I often pass variables to the backend using associative arrays.
However, I can't seem to associate the error label with the group as a
whole, as in HTML Form terms, it's actually 2 separate elements,
rather than array (which PHP sees it as).
Associative Array Test
At least one
Not sure if this is the best reply, but in order to access the
structure, it has to be part of the DOM, so best to inject in into a
placeholder first:
$('#placeholder).html(xml) // probably need to kill the xml
declaration first
Then you can use jQuery to traverse the tree.
:D
Great stuff!
In the meantime I'm looking forward to learning even more about your
fabulous, time-saving plugin.
Cheers!
Dave
n override the error element like this. I've
checked and it works great.
But unless I'm mistaken, it's missing from the validation options
documentation!
Cheers,
Dave
On Jan 24, 8:35 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Dave Stewart schrieb:> Hello,
> >
Jörn,
"highlight" does exactly what I want if I pass it an empty function,
so that's great.
How about adding the option to pass "null" or "false" for those times
when you want to do nothing and just let the the error message take
the strain?
Cheers,
Dave
Pete,
Great little plugin there! I've done teh same using vanilla
JavaScript; have yet to convert it to jQuery but this is a nice
insight.
One problem (bug) is that you seem to have to click (then it freezes)
then release to move around, then re-click to cancel.
Do you know why the mouse handler
Hi MorningZ,
I just did some quick Googling on the matter, and turned up this
useful link:
http://www.456bereastreet.com/archive/200711/use_the_label_element_to_make_your_html_forms_accessible/
"Each label element can only be associated with a single form control,
while a form control may have s
Jörn, Thanks!
That was what I wanted! A lot of jQuery plugins have so many options
that sometimes it's difficult to see the wood for the trees.
Thanks again for pointing this out
Diego, thank you also for your input into this matter.
Cheers,
Dave
SORRY - the word [jQuery Validation Plugin] was supposed to appear in
the title, but didn't.
To restate the problem:
When I validate a form using the jQuery Validation Plugin, when it
comes across a form element that doesn't validat, it does 2 things:
1. Adds, or shows the corresponding error
SORRY - the word [jQuery Validation Plugin] was supposed to appear in
the title, but didn't.
Hello Diego,
Sorry, it's a separate question, actually. I've re-stated the first
post question to clarify things, so sorry for the ambiguity.
To restate the problem:
Using the jQuery Validation Plugin,
Pretty much sums it up really.
I only want the error label (of class "error") to be displayed, but
not the class of the text box or such like to have it's class updated.
Thanks,
Dave
Hello,
I'd rather not use tags for my error messages, as I think
s are less semantically ambiguous.
Is there any way I can change the default functionality?
At the moment I'm placing my own error s manually, but I can't
get them to show unless I change them to s
Help!
And thanks very much.
Chee
Hi Alex,
Amazing project. I'd be interested to know more about the generative
stuff.
How are the particles generated? In Flash?
Cheers,
Dave
Whoops, forgot to mention, I had set up this page to test it:
http://www.conciencia.net/Temp/IncludeTest.htm
to dynamically load each listed file one after the
other. It might be beneficial because it doesn't load the script for
making jqModal work until it's needed. This might not be the best
example, but it shows what it can do.
/*
* jQuery.include - A dynamic javascript/css loader plugin for jQu
Go to www.conciencia.net and click either of the two buttons
underneath the calendar (Escuche/Vea el programa), the "Preguntas
Frecuentes" link, or any of the links in the grey box further down on
the page. I actually don't have Safari available to test this myself,
but I asked someone to test it
61 matches
Mail list logo