[jQuery] Re: Disable Submit button if no text entered

2008-05-14 Thread Michael E. Carluen

Another suggestion will be to get the length of the field:

var t = ($('#post_name').val()).length;
if (t > 0) {
$("[EMAIL PROTECTED]").removeAttr('disabled');
}

This way, you can even have the option of enforcing a minimum char length of
the field/s.

Michael


> It seems that submit method is not what this case requires because it does
> the job when user interacts with submit button (correct me please if I'm
> wrong). The button should be disabled if both field and textarea (now they
> are id's ;) do not contain any text, to prevent blank records. And the
> only
> event that might check contents of textareas and inputs seems to be
> keyup...



[jQuery] Re: Site Submission, finally!! :-)

2007-10-10 Thread Michael E. Carluen

Hey Rick,

My client, http://jingleads.com (also a jQuery powered site), has been
seeing a trend of a growing number of sites requesting 3 to 5 second landing
page musical jingles and audio signature snippets. I'm sure music on sites
work, it just depends on what people are trying to sell or convey.

Michael


> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Rick Faircloth
> Sent: Wednesday, October 10, 2007 2:36 AM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: Site Submission, finally!! :-)
> 
> 
> I'm had to talk a lot of clients out of using music on their homepage,
> Steve.
> But, I think, for this site, music works.
> 
> One, the music is very "low profile"... not blaring.
> Two, there's no content on the homepage that requires concentration, such
> as content I have to read, so the music doesn't compete.  There's just the
> slideshow of cars, which, if created in video, would normally have musical
> accompaniment anyway.  You got what amounts to a splash page for the
> homepage,
> so, I think, the music works...
> 
> Nice job with everything.
> 
> Rick
> 




[jQuery] load() with each(): FF is OK, IE not

2007-09-10 Thread Michael E. Carluen
Hi all:

Is there anyone who can tell me what is wrong with this, and if there are
any suggestions to fix.  Works OK on Firefox, but not on IE:

 

On the test.htm:

 





$(function(){ 

$("#testdiv").load("testload.htm");

});





 

 

 

On the testload.htm

 



$(function(){ 

$("span.hitme").each(function(){ 

var itemvar =
$(this).attr("id"); 

$(this).click(function(){

alert(itemvar);

});

});

});



One



Two



Three

 

Thanks!

Michael



[jQuery] Re: divert click to an anchor

2007-08-21 Thread Michael E. Carluen

John:

Try using bind(); with click()

$("div.test").bind("click", function(){ 
 $("a").click();
});

Hth,

Michael


> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of John Liu
> Sent: Tuesday, August 21, 2007 6:53 PM
> To: jQuery (English)
> Subject: [jQuery] divert click to an anchor
> 
> 
> 
> 
> 
> $(document).ready(function(){
>   $("div.test").click(function(){
>  alert('div.test clicked');
>  $("a").click();
>   });
> });
> 
> http://google.com";> google 
> click
> 
> 
> I have a situation where if anyone clicks anywhere within the div, I
> want the anchor to be fired - in this case, navigate to google.com.
> Why doesn't the above code work?
> 
> thanks in advance.
> jliu



[jQuery] fckEditor fails on show();

2007-08-12 Thread Michael E. Carluen
Hello all,

I have a div that contains a form with fckEditor .  The div is initial
hidden using display: none;. Once I use show() to reveal the form, the div
and fckEditor shows, but the editor tools does not work on Firefox5 (works
on IE7).  Any suggestions?

Thanks.

Michael

 



[jQuery] Re: SITE SUBMISSION: Please add gsalr.com to the list of sites

2007-07-26 Thread Michael E. Carluen
Perfectly understandable, and no problem Marshall. Again, awesome job on a
slick app.

 

To all: my apologies for the Off-topic response.  I just went a little to
quick on the reply button, after seeing Marshall's nice app.

 

Michael 

 

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Marshall Salinger
Sent: Thursday, July 26, 2007 4:20 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: SITE SUBMISSION: Please add gsalr.com to the list of
sites

 

Hi Michael,

I wish I could offer you the answer. It is all the work of a guru back-end
developer that I work with. I don't know how he does it. Only he knows the
answer and I don't think he is willing to part with it at the moment.

Best of luck,
Marshall

Michael E. Carluen wrote: 

To phrase to question better, how were you able to parse the addresses if
you're getting the data from craigslist directly? Or which web service are
you using if you're using one?

 

 

  _  

From:  <mailto:jquery-en@googlegroups.com> jquery-en@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Michael E. Carluen
Sent: Thursday, July 26, 2007 1:23 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: SITE SUBMISSION: Please add gsalr.com to the list of
sites

 

Nicely done Marshall.  How are you able to mashup the Craigslist data?  I
have been looking into that.  Any advise?

 

 

 

 

  _  

From:  <mailto:jquery-en@googlegroups.com> jquery-en@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Marshall Salinger
Sent: Thursday, July 26, 2007 1:09 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] SITE SUBMISSION: Please add gsalr.com to the list of sites

 

Hello Rey,

I was wondering if you could add gsalr.com to the list of sites that use
jQuery. The site is a mashup of Google Maps / Craigslist and a few other
sites that list garage sales on the web. The site provides a map view of
garage sales in various cities across the United States. The site also
provides a feature called the Trip Planner and allows you to save sales to a
list and then retireve printable directions from one sale to the next. The
site is still very much in beta and critiques are welcomed.

Various plugins are being used on the site. They include:

- jQuery Interface
- dimensions
- tablesorter 1.0

Thanks again to the jQuery team for such an amazing tool and to everyone
that contributes their plugins.

-Marshall

 



[jQuery] Re: SITE SUBMISSION: Please add gsalr.com to the list of sites

2007-07-26 Thread Michael E. Carluen
To phrase to question better, how were you able to parse the addresses if
you're getting the data from craigslist directly? Or which web service are
you using if you're using one?

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michael E. Carluen
Sent: Thursday, July 26, 2007 1:23 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: SITE SUBMISSION: Please add gsalr.com to the list of
sites

 

Nicely done Marshall.  How are you able to mashup the Craigslist data?  I
have been looking into that.  Any advise?

 

 

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Marshall Salinger
Sent: Thursday, July 26, 2007 1:09 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] SITE SUBMISSION: Please add gsalr.com to the list of sites

 

Hello Rey,

I was wondering if you could add gsalr.com to the list of sites that use
jQuery. The site is a mashup of Google Maps / Craigslist and a few other
sites that list garage sales on the web. The site provides a map view of
garage sales in various cities across the United States. The site also
provides a feature called the Trip Planner and allows you to save sales to a
list and then retireve printable directions from one sale to the next. The
site is still very much in beta and critiques are welcomed.

Various plugins are being used on the site. They include:

- jQuery Interface
- dimensions
- tablesorter 1.0

Thanks again to the jQuery team for such an amazing tool and to everyone
that contributes their plugins.

-Marshall



[jQuery] Re: SITE SUBMISSION: Please add gsalr.com to the list of sites

2007-07-26 Thread Michael E. Carluen
Nicely done Marshall.  How are you able to mashup the Craigslist data?  I
have been looking into that.  Any advise?

 

 

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Marshall Salinger
Sent: Thursday, July 26, 2007 1:09 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] SITE SUBMISSION: Please add gsalr.com to the list of sites

 

Hello Rey,

I was wondering if you could add gsalr.com to the list of sites that use
jQuery. The site is a mashup of Google Maps / Craigslist and a few other
sites that list garage sales on the web. The site provides a map view of
garage sales in various cities across the United States. The site also
provides a feature called the Trip Planner and allows you to save sales to a
list and then retireve printable directions from one sale to the next. The
site is still very much in beta and critiques are welcomed.

Various plugins are being used on the site. They include:

- jQuery Interface
- dimensions
- tablesorter 1.0

Thanks again to the jQuery team for such an amazing tool and to everyone
that contributes their plugins.

-Marshall



[jQuery] Re: Highlighting contents of an Input field on click()

2007-07-19 Thread Michael E. Carluen
I just got it. I had .focus() instead of .select().  OK gotta end the long
day now.

 

So carry on folks.  nothing to see here..

 

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michael E. Carluen
Sent: Thursday, July 19, 2007 1:05 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Highlighting contents of an Input field on click()

 

Hello jQ folks, 

 

(pardon me, but I just got braindead right when I'm trying to wrap-up the
final leg of a very long day.)

 

I just wanted to highlight the contents of an input field (read-only) on a
.click() event. Similar to when your click the url or embed fields in
YouTube to highlight the field contents.

 

I appreciate a brain jump-start from anyone, anywhere.

 

Mucho thanks!

 

Michael



[jQuery] Highlighting contents of an Input field on click()

2007-07-19 Thread Michael E. Carluen
Hello jQ folks, 

 

(pardon me, but I just got braindead right when I'm trying to wrap-up the
final leg of a very long day.)

 

I just wanted to highlight the contents of an input field (read-only) on a
.click() event. Similar to when your click the url or embed fields in
YouTube to highlight the field contents.

 

I appreciate a brain jump-start from anyone, anywhere.

 

Mucho thanks!

 

Michael



[jQuery] Re: Plugin Annoucements and Additions to Plugin Library

2007-07-16 Thread Michael E. Carluen

Cool deal, thanks for your offer, Rey... that's awesome. Nothing to ask for
now, though.  The thought just occurred to me when I saw Alexander's
Horizontal Accordion. 



> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Rey Bango
> Sent: Monday, July 16, 2007 2:08 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: Plugin Annoucements and Additions to Plugin Library
> 
> 
> Hi Michael,
> 
> Its each plugin author's responsibility to submit it to the plugin repo.
> That way, they can add the proper info about the plugin and update it as
> needed.
> 
> With that said, I do my best to keep track of all new plugins and have
> many downloaded. If you ever find yourself in a bind, please don't
> hesitate to email me.
> 
> Rey...
> 
> Michael E. Carluen wrote:
> > Hello everyone.
> >
> >
> >
> > I have always (wrongfully?) assumed that all the plugins announced on
> > the list, gets added to the plugin library by Rey or someone from the
> > evangelism team.  That is why I never bookmark the author's plugin sites
> > thinking that I can just find it on the library page of the site when I
> > need it.  But like the saying goes, most assumptions are wrong. ?  I am
> > curious whether it'll PITA to find some of the awesome plugins I have
> > seen announced here recently.
> >
> >
> >
> > My question is who is really responsible for **ensuring** that a new
> > plugin is added or "registered" to the plugin library?  Can someone
> > clarify or verify?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Michael
> >
> 
> --
> BrightLight Development, LLC.
> 954-775- (o)
> 954-600-2726 (c)
> [EMAIL PROTECTED]
> http://www.iambright.com



[jQuery] Re: Plugin Annoucements and Additions to Plugin Library

2007-07-16 Thread Michael E. Carluen
Aha! . thanks Chris.  Hmmm.  Also, I just noticed the Plugin Note dated June
18th, saying in effect the same thing (for un-official plugins) dooh!

 

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Christopher Jordan
Sent: Monday, July 16, 2007 1:55 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Plugin Annoucements and Additions to Plugin Library

 

Michael,

I might be wrong, but I believe that unless it's an "official" plug-in, that
it's the plug-in author's responsibility to update the plug-ins page with a
link to download, examples, etc. 

Chris

On 7/16/07, Michael E. Carluen <[EMAIL PROTECTED]> wrote:

Hello everyone.

 

I have always (wrongfully?) assumed that all the plugins announced on the
list, gets added to the plugin library by Rey or someone from the evangelism
team.  That is why I never bookmark the author's plugin sites thinking that
I can just find it on the library page of the site when I need it.  But like
the saying goes, most assumptions are wrong. ?  I am curious whether it'll
PITA to find some of the awesome plugins I have seen announced here
recently.

 

My question is who is really responsible for *ensuring* that a new plugin is
added or "registered" to the plugin library?  Can someone clarify or verify?

 

Thanks,

 

Michael




-- 
--
http://cjordan.us 



[jQuery] Plugin Annoucements and Additions to Plugin Library

2007-07-16 Thread Michael E. Carluen
Hello everyone.

 

I have always (wrongfully?) assumed that all the plugins announced on the
list, gets added to the plugin library by Rey or someone from the evangelism
team.  That is why I never bookmark the author's plugin sites thinking that
I can just find it on the library page of the site when I need it.  But like
the saying goes, most assumptions are wrong. ?  I am curious whether it'll
PITA to find some of the awesome plugins I have seen announced here
recently.

 

My question is who is really responsible for *ensuring* that a new plugin is
added or "registered" to the plugin library?  Can someone clarify or verify?

 

Thanks,

 

Michael



[jQuery] Even Dojo site uses jQuery

2007-06-10 Thread Michael E. Carluen
http://dojotoolkit.org/developer

Yes, the "list" continues to grow. I find it a little amusing to see that
even the Dojo site uses jQuery and its plugins.



[jQuery] Using getJSON for pre-loading Wil's Star Rating initial avg values

2007-05-26 Thread Michael E. Carluen
Hello jQuery folks,

I am working on using Wil Stuckey's  Star Rating plugin.  I am trying to
load the initial values using $.getJSON.  Can someone let me know why the
following does not work?

 

$.getJSON("get_all_values.cfm", function(jsonval){

 $('#ratingform1').attr("title","Average Rating: " + jsonval.ravg1);

});

 

For those familiar with the plugin, how did you pre-load the star values.
Btw, I wanted to keep the calling page as a simple html page.

 

Thanks in advance, everyone.

 

Michael

 

 



[jQuery] Re: JQuery Powered Site- Just Launched- AskSolvers.com

2007-05-18 Thread Michael E. Carluen

Yeah... some 20 something odd years ago that is.  There's nothing like
putting your young to work early- their college ain't cheap, eh.  It's all
fun getting the kids involved in projects, you should try it.

Happy Friday to you Chris.


> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Chris W. Parker
> Sent: Friday, May 18, 2007 9:39 AM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: JQuery Powered Site- Just Launched- AskSolvers.com
> 
> 
> On Thursday, May 17, 2007 4:41 PM Michael E. Carluen <> said:
> 
> > I just launched a new jQuery powered site- http://asksolvers.com
> > <http://asksolvers.com/>   .  It is still pretty new, and still in
> > the process of publicly promoting the site...  comments and
> suggestions
> > welcome.
> 
> Those are some hilarious pictures. Is that you?



[jQuery] JQuery Powered Site- Just Launched- AskSolvers.com

2007-05-17 Thread Michael E. Carluen
Hi Rey (Bango) and all.

 

I just launched a new jQuery powered site- http://asksolvers.com
<http://asksolvers.com/>   .  It is still pretty new, and still in the
process of publicly promoting the site.  comments and suggestions welcome.

 

I used jquery's core ajax in some of the forms. The UI uses several plugins:
highlightFade, cfjs, curvycorners. (and boy, I just wish I could've used
more. but that'll come).

 

As always, special thanks go to John Resig and the talented jQuery
behind-the-scenes team for making it all possible; the authors Blair
Mitchelmore, Chris Jordan, Stefan Holmberg and everyone else who contributed
to your plugins.  

 

Y'all Rock! jQuery Rules!!

 

Michael E. Carluen

 



[jQuery] Re: CFJS plugin

2007-05-02 Thread Michael E. Carluen

Hey Chris,
I just put CFJS to work on a few things.  Thanks for working on this. Seems
like its going one of those frequently used tools in the toolbox.
Michael




> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Christopher Jordan
> Sent: Tuesday, May 01, 2007 7:08 AM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: CFJS plugin
> 
> 
> Yeah, I think it's a bug. I'll fix it. :o)
> 
> Chris
> 
> Andy Matthews wrote:
> > I don't know if the array "bug" is a bug or a feature. Coldfusion
> actually
> > starts counting arrays at 1. So it's possible that could be intentional,
> > although given that this is a javascript plugin, it's probably a bug.
> >
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > Behalf Of Ariel Jakobovits
> > Sent: Tuesday, May 01, 2007 2:04 AM
> > To: jquery-en@googlegroups.com
> > Subject: [jQuery] CFJS plugin
> >
> >
> > Hi Chris,
> >
> > nice plugin. great idea. very useful. 2 things:
> >
> > 1) the packed version doesn't seem to load properly. something about a
> > comma.
> >
> > 2) your ListToArray function starts adding to the array at index 1, not
> 0.
> >
> > thanks for the plugin, i really like it.
> >
> > -Ariel
> >
> >
> >
> >
> 
> --
> http://cjordan.info



[jQuery] Re: ErrorMsg: 'Permission denied to call method XMLHttpRequest.open'

2007-04-29 Thread Michael E. Carluen
Thanks Jake.

 

You nailed it, pal!

 

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Sent: Sunday, April 29, 2007 10:27 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: ErrorMsg: 'Permission denied to call method 
XMLHttpRequest.open'

 

probably you hard coded the location of the ajax url to a site other than the 
one where you served the page.

specifying the host in an ajax url will always cause similar errors.

On 4/29/07, Michael E. Carluen <[EMAIL PROTECTED]> wrote:

Hello Everyone:

 

I ran Firebug on a page that was supposed to be displaying a hidden DIV on 
toggle event, but fails. The div contains data from a .load().  The following 
error message was displayed:

 

[Exception... "'Permission denied to call method XMLHttpRequest.open' when 
calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e 
(NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]

 

Anyone has any ideas on where I should check first?

 

Thanks in advance.

 

Michael




-- 
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ 



[jQuery] ErrorMsg: 'Permission denied to call method XMLHttpRequest.open'

2007-04-29 Thread Michael E. Carluen
Hello Everyone:

 

I ran Firebug on a page that was supposed to be displaying a hidden DIV on
toggle event, but fails. The div contains data from a .load().  The
following error message was displayed:

 

[Exception... "'Permission denied to call method XMLHttpRequest.open' when
calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]

 

Anyone has any ideas on where I should check first?

 

Thanks in advance.

 

Michael



[jQuery] Re: Image dynamic resizing

2007-04-20 Thread Michael E. Carluen

This is cool Remy. I can see it work like BritePic http://www.britepic.com/
Any plans on further adding other features for a full blown plug-in?



> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Remy Sharp
> Sent: Friday, April 20, 2007 5:07 PM
> To: jQuery (English)
> Subject: [jQuery] Re: Image dynamic resizing
> 
> 
> I've just (like in the last 5 minutes) written a zoom plugin that will
> resize the image on the fly when requested.
> 
> You could link a slider (Ext?) or input box to change the size and
> call the plugin against the image:
> 
> http://remysharp.com/wp-content/uploads/2007/04/zoom.js
> 
> On Apr 21, 12:21 am, Ad4m <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I need some script for dynamically resize an image with jquery. Are
> > there any plugins to handle this?
> >
> > regards
> > Adam



[jQuery] Re: My first plugin, overlabel

2007-04-01 Thread Michael E. Carluen
Hi Karl,

 

Cool revision, Karl. and I'm all good, pal. I actually did the same thing
when I saw Scott's post. did something with a bit just for kicks to see if
it can be done another way. Constructive feedback is always healthy. I
definitely think we all need to challenge each other or play each other
devil's advocate so we can crank out better, shorter scripts.  Doing so, we
might even have a chance to solve world hunger all in just 5 lines of jQuery
code.

 

Cheers, and have a great week ahead.

 

Michael

 

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Sunday, April 01, 2007 6:16 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: My first plugin, overlabel

 

Hi Michael, 

 

That looks like it would do what you're shooting for. 

 

I played around with it a bit just for kicks, seeing if I could condense
things, and came up with this:

 

$('#userid_field,#password_field').focus(function() {

$(this).attr({ class: 'login_fields'}).val('');

if ($(this).is('#password_field')) {

$(this).attr('type', 'password');

};

}).blur(function() {

if ( !$.trim($(this).val()) && $(this).is('#userid_field') ) {

$(this).attr('class', 'login_labels').val('userid');

} else if ( !$.trim($(this).val()) && $(this).is('#password_field') ) {

$(this).attr({ class: 'login_labels', type: 'text'}).val('password');

};

});

 

I personally still prefer the approach that uses labels (and actually wrote
up my own little script doing the same thing for the book) for the
accessibility and graceful degradation, but I guess I could see a place for
both. 

 

One other thing that you might want to consider is that your script empties
the inputs even after a user has typed in something and then returns to it.
This might prove frustrating to someone who types in a long user name, sees
a typo, and returns to the field to fix it, only to find that the user name
is wiped out and he or she has to start all over again. On focus, you might
want to check for this.value == this.defaultValue or something of the sort.

 

I'm hoping you'll take this all as constructive feedback. :)



 

Cheers, 

 

--Karl

_

Karl Swedberg

www.englishrules.com

www.learningjquery.com

 





 

On Apr 1, 2007, at 5:39 PM, Michael E. Carluen wrote:





Hi Scott, Karl:

Below, is a revised version of the script I sent earlier that addresses the
blur event.

I frequently require Javascript enabled as a minimum, that is why I often
regret to remember about graceful degradation. In any case Scott, your
plugin definitely is more flexible, I agree. - Michael

.login_labels{color: #708090;}



[jQuery] Re: My first plugin, overlabel

2007-04-01 Thread Michael E. Carluen
Hi Scott, Karl:

Below, is a revised version of the script I sent earlier that addresses the
blur event.

I frequently require Javascript enabled as a minimum, that is why I often
regret to remember about graceful degradation. In any case Scott, your
plugin definitely is more flexible, I agree.  - Michael

 

 



  .login_labels{color: #708090;}

  .login_fields{color: #000;}



 



$('#userid_field').focus(function() {

  $(this).attr({ class: 'login_fields'}).val('');

  });

 $('#userid_field').blur(function() {

  var userval = $(this).val();

  var userval = $.trim(userval);

if (userval == '') {

$(this).attr({ class: 'login_labels'}).val('userid');}

   }); 

   

 $('#password_field').focus(function() {

  $(this).attr({ class: 'login_fields', type: 'password'}).val('');

  });  

  $('#password_field').blur(function() {

  var userval = $(this).val();

  var userval = $.trim(userval);

if (userval == '') {

$(this).attr({ class: 'login_labels', type:
'text'}).val('password');

}

   });



 

 

 

 

> -Original Message-

> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On

> Behalf Of Scott Sauyet

> Sent: Sunday, April 01, 2007 11:54 AM

> To: jquery-en@googlegroups.com

> Subject: [jQuery] Re: My first plugin, overlabel

> 

> 

> Michael E. Carluen wrote:

> > I am curious as to what might be the advantage of using your overlabel

> > plugin versus a much shorter script like the one below?

> 

> I posted your suggested code at

> 

>  http://scott.sauyet.com/Javascript/Demo/Overlabel/test.html

> 

> and a simple version of mine at

> 

>  http://scott.sauyet.com/Javascript/Demo/Overlabel/simple.html

> 

> I think you misunderstood the point of the script.  Yours clears the

> input boxes on focus.  I guess there might be times when that is useful,

> but that wasn't the point of mine.

> 

> Mine was meant to reduce the space taken by a label together with an

> input box.  It puts the labels on top of the input boxes so that you

> know what has to be entered in them.  On focus that text was cleared,

> but it returned on blur unless you've entered text in the box, in which

> case, your text displays.  If you look at the simple version above

> without Javascript and with Javascript, you should see how the space

> taken by the form is reduced.

> 

> Karl Swedberg suggested that this had to do with accessibility and

> graceful degradation.  That is certainly correct, but the main point is

> simply to reduce the screen real estate taken by the form.

> 

>-- Scott



[jQuery] Re: My first plugin, overlabel

2007-04-01 Thread Michael E. Carluen

Hi Scott:

I am curious as to what might be the advantage of using your overlabel
plugin versus a much shorter script like the one below?

-Michael


.login_labels{color: #eee;}
.login_fields{color: #000;}



$(function(){
$('#userid_field').focus(function() {
$(this).attr({ class: 'login_fields'}).val(''); });
$('#password_field').focus(function() {
$(this).attr({ class: 'login_fields', type: 'password'}).val('');
}); });
   

 



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Scott Sauyet
> Sent: Saturday, March 31, 2007 1:55 PM
> To: jQuery Discussion
> Subject: [jQuery] My first plugin, overlabel
> 
> Hi Folks,
> 
> I'm fairly new to JQuery.  I recently needed a technique I had seen
> recently on A List Apart to combine labels and text input boxes into a
> single control in order to save space.  The technique is at
> 
>  http://alistapart.com/articles/makingcompactformsmoreaccessible
> 
> The Javascript there looked like a lot for what was done, so I tried to
> simplify it into a JQuery plug-in.  I'm looking for advice as to whether
> this is done in the best way possible.  A demo page is at
> 
>  http://scott.sauyet.com/Javascript/Demo/Overlabel/
> 
> and I've posted a blurb about it on my blog:
> 
>  http://tinyurl.com/2vx4n8
> 
> The code is fairly simple and much simpler than the original (see the
> original article or the commented out code in the demo page), but I'm
> wondering if there are further simplifications that should be made.  I'm
> especially bothered by the number of times I am switching between DOM
> objects and their JQuery counterparts.  It seems somehow counterintutive
> that I should need to do so as many times as I do.
> 
> Any advice would be appreciated.
> 
> This is the plug-in code:
> 
>  jQuery.fn.overlabel = function() {
>  this.each(function(index) {
>  var label = $(this); var field;
>  var id = this.htmlFor || label.attr('for');
>  if (id && (field = document.getElementById(id))) {
>  var control = $(field);
>  label.addClass("overlabel-apply");
>  if (field.value !== '') {
>  label.css("text-indent", "-1000px");
>  }
>  control.focus(function () {label.css("text-indent",
> "-1000px");}).blur(function () {
>  if (this.value === '') {
>  label.css("text-indent", "0px");
>  }
>  });
>  label.click(function() {
>  var label = $(this); var field;
>  var id = this.htmlFor || label.attr('for');
>  if (id && (field = document.getElementById(id))) {
>  field.focus();
>  }
>  });
>  }
>  });
>  }
> 
> And it would be called like this:
> 
>  $(document).ready(function() {
>  $("label.overlabel").overlabel();
>  });
> 
> 
> I'm also wondering what the thought is on just how much plug-ins should
> stand on their own.  This right now is dependent upon rules being
> defined in the CSS for the label (position: absolute, top, left,
> z-index) and for a common ancestor of the label and the input box
> (position:relative or absolute).  I could do all this in the plug-in, of
> course, but that limits flexibility on the CSS side.  Is there any
> established wisdom about this in the JQuery community?
> 
> Thanks for any insight you can offer,
> 
>-- Scott Sauyet
> 
> 
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/