[jQuery] Re: jQuery updatable graph

2009-10-14 Thread Scott Haneda


Have you looked at Raphaèl?

--
Scott
Iphone says hello.

On Oct 14, 2009, at 5:47 AM, megladon chap...@gmail.com wrote:



I am looking for a pie chart that I can update by jQuery. I have used
sparklines but I cant get it to update without a page refresh. Has
anyone used such a graph?


[jQuery] Accordion, there are too many

2009-10-12 Thread Scott Haneda


There are just too many accordions out there, can someone point me in  
the right direction.  This need not be fancy:


div class=post
h3title 1/h3
psome copy here/p
psome more copy here/p
pand some more copy here/p

h3title 2/h3
psome copy here/p
psome more copy here/p
pand some more copy here/p

h3title 3/h3
psome copy here/p
psome more copy here/p
pand some more copy here/p
/div

On load, I would want the all p's hidden, which are in the class post,  
or, if I could say all p's that are children of the h3's, but I am not  
sure technically, they are children.


The first h3 of course should not be hidden.  On clicking any of the  
h3's, which I will href a link to '#' on, that one should go from  
hidden to shown.  Clicking on any other h3, will toggle the one that  
is on, to off, and then turn the clicked one on.


Basic, every example I find breaks in some way, or spends a lot of  
time prettying it up, which I do not need.   A final link at the  
bottom to expand all would be nice.


About 80% of the examples out there fail on more than 1 p tag after  
the h3. I suppose I am going to have to wrap each in a set of divs?


Thanks
--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread Scott Haneda


That would make sense, since `do` is a language keyword:
do {
code to be executed
}

while (var = endvalue);

I am sure there is a way to escape it, though in the same way I am  
fearful of using if/else/for/while/var and all the test as name/value  
pairs in JS or jQ, I would look to change it.


I have for a long time used 'act' which to me works better than do, as  
do means positive action, so you get into cases where you will see  
do=noprocess, or do=donotprocess, the cases of double-negative can  
lead to confusion.


act={add, update, delete, inset} that all is pretty clear.
Sorry I was not more help, just my opinion.
--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 27, 2009, at 5:37 AM, indre1 wrote:



After 3 DAYS, I finally figured it out:
$.get('profile.php', { do: 'addfriend', id: userId }

The problem is, that the word do is reserved or something, thus you
can't use it in get, ajax and probably elsewhere. test.php?
do=something will never work from jQuery then, or how should I escape
it?
Is this a bug or just something everyone has to know? Strangely, on FF
it all worked.

$.get('profile.php', { action: 'addfriend', id: userId } works
perfectly.

On Sep 27, 1:27 pm, indre1 ind...@gmail.com wrote:

Well, the problem still seems to be in the get() function. For
example, IE gives the following error: Object doesn't support this
property or method
With:
(function($) {
  $.fn.followUser = function(userId) {
  this.fadeOut(250, function(){
  $.get('profile.php', { do: addfriend, id:  
userId }, function

(data){
  return this.html('pFollower added/ 
p').fadeIn(250);

  });
  });
  }

})(jQuery);

If I remove the whole $.get() part, the error is gone. Chrome will
start fading out too. The code will then look like:
(function($) {
  $.fn.followUser = function(userId) {
  this.fadeOut(250, function(){

  });
  }

})(jQuery);

I even tried replace the get() with ajax(), but ran into the same
problem.

Btw, thanks for the attr('rel') suggestion. This is something I was
also looking for, but couldn't figure it out :) The html is now:
script type=text/Javascript
$(function(){
$('div#followButton a').click(function(){
$('div#followButton a').followUser($ 
(this).attr('rel'));

});});

/script

...

div id=followButton
a rel=2test1/a
/div

On Sep 26, 6:48 pm, Matt Quackenbush quackfu...@gmail.com wrote:

@ Mike - Thanks for making me take a closer look at the original  
code.  I

get it now.  My bad.



/me crawls back into his cave to hibernate some more




[jQuery] Re: how to serialize an array?

2009-09-26 Thread Scott Haneda


Could you use get.JSON?
http://docs.jquery.com/Ajax/jQuery.getJSON

You could of course also use post, but for quickies I use get:
$.getJSON(example.php, { name: John, time: 2pm }, function(json) {
 alert(JSON Data:  + json.users[3].name);
});

In the above, example.com/?name=Johntime=2pm is what will be sent  
along.


If you are just reading data, I would use getJSON, if you are going to  
have your php script do updating and other things, look at.post() like  
you are.


My understanding of serialize is that it will convert input elements  
to name=value pairs.  Since you already have an array, it sounds to me  
like you just need to convert it to a url ready format.


if you want to convert it to JSON, I believe you use serializeArray  
instead

http://docs.jquery.com/Ajax/serializeArray

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 26, 2009, at 3:44 AM, Althalos wrote:


I have an array in a Javascript/jQuery code, and I want to pass it to
a php file. It has an arbitrary number of elements in it. So I figured
I would use $.post, HOWEVER, I'm sure how I would convert my array
into a suitable data-string?

$.post(test.php, data);  what should data be when I want to pass
an entire array?

I looked around a bit on Google and I found the function serialize
which seems to do what I want. But it only works on forms and not on
arrays...




[jQuery] Re: about jquery?

2009-09-26 Thread Scott Haneda


Neither.  Learn to figure out the right tool for the job.  When it  
comes to web development, you will mostly use jQuery on the client  
side, and ASP or php on the server side.


If you just want to start to learn programming, start with jQuery, or  
probably a little JavaScript first, since jQuery is a framework that  
helps make hard things in JavaScript much easier and more elegant.  I  
suggest this because there is no barrier of entry to JavaScript.  You  
just need a text editor and a browser.


With php and asp, you need a server, or at least, to take the time to  
learn how to set up and install those things on your local computer.

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 26, 2009, at 4:09 AM, ask wrote:


what is better to start learning first? \
the JQuery  /\   ASP.net /\  or PHP?




[jQuery] Re: Every post I make, I get an mail error.

2009-09-26 Thread Scott Haneda


I believe what happens, is there is a bad address in the group, so  
when you post a message to the list, it is sent out to all subscribers.


Final-Recipient: rfc822; r...@localhost
Original-Recipient: rfc822;r...@localhost
Action: failed
Status: 5.3.0

If an email is sent from the group to r...@localhost, it will bounce,  
and I am guessing it is bouncing back to the group.  Some people are  
getting this backscatter, and others are not.  If I were to look at my  
server logs, I would bet I see it, but I have my server set to block  
messages that are backscatter, or have bogus recipients and  
destinations.


The list admin needs to find r...@localhost I believe, that would  
solve it, though I think the issue is technically deeper than that  
quick fix.


--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 26, 2009, at 8:10 AM, Charlie wrote:

I posted this issue into Google Groups help forum yesterday, only  
response so far group won't recognize your email address which is  
not true


Will see what happens

Bertilo Wennergren wrote:



evo wrote:


Everytime I post to this group through thunderbird, I get a
undelivered mail message sent back, everytime.
This has only started happening recently and I can't find any info
about it anywhere.

Just want to know if this is happening to anyone else (as it's only
when I post to this group)


I get those too.




[jQuery] Re: Update Text or HTML

2009-09-26 Thread Scott Haneda


I believe you need to narrow it down some more, or you are going to  
replace everything:


!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
 script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js 
/script

script type=text/javascript charset=utf-8
  $(document).ready(function() {
   $('#title').html('new text inseted by jQ');
  })
/script

style type=text/css media=screen
  p { margin: 0; padding: 0; }
/style
/head

body
 div
  p id=titleSome Title Text/p
  divAdd | Edit | Delete/div
/div
/body
/html

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 26, 2009, at 4:18 PM, Dave Maharaj :: WidePixels.com wrote:


I have a div inside a div:

div class=heading id=some_idSome Title Text
div class=manage_optionsAdd | Edit | Delete/div
/div

I simply want to change the Some Title Text and leave the Add Edit  
Delete

as is but my

script type=text/javascript
$(document).ready(function() {
$('.heading').html(My New Title);
})
/script

Strips everything out, how can i select to only change the heading  
text?




[jQuery] Re: been asked 1000 times?

2009-09-26 Thread Scott Haneda


Correct, you can not have duplicate #id's so you will need to change  
those to classes. However, I am not sure that is valuable to you,  
since why would you want to have a click event change *everything* in  
all your divs you listed from the server side output below?


I would change the server side, so that you have a counter, and can  
produce:


div id=open-frame-1 url=/page1.asp class=open-frametext/div
div id=open-frame-2 url=/page1.asp class=open-frametext/div
div id=open-frame-3 url=/page1.asp class=open-frametext/div
div id=open-frame-4 url=/page1.asp class=open-frametext/div

Now, you have class of .open-frame for the general styling, and you  
have an #id you can act in on jQuery.  I believe you could in fact  
just use any id name you want, and not need to be sequential about it,  
since 'this' will refer to the item you click on, but it is always  
good to be able to reference an element you acted on specifically.


Now it should be pretty easy to
$(document).ready(function() {
 $('.open-frame').click(function() {
  $(this).do.something.to.what.you.clicked
 };
})

I am a few weeks into jQ myself, I could be way off base on this  
suggestion, so take it wit a grain of salt.

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 26, 2009, at 12:38 PM, monkeyman wrote:



Hiya, I'm really new at jquery, but not programming.

I'd like to display some items dynmically from a DB, and have them
call a common jquery function onclick, passing some params.

this is a snippet of my Client side code 

$('#open-frame').click(function() {

url = $(this).attr(url);
h = $(this).attr(h);
w = $(this).attr(w);
$(#dialog).dialog.height=parseInt(h)+40;
$(#dialog).data(width.dialog, parseInt(w)+35);
var numRand = Math.floor(Math.random()*101)
setIframe('theFrame',h,w,url +  + numRand);
$('#dialog').dialog('open');

}


Server Side output
---
div id=open-frame url=/page1.asp h=300 w=400 class=long
text 1 that should do something onclick/div
div id=open-frame  url=/page2.asp h=300 w=400 class=long
text 2 that should do something on click/div
div id=open-frame  url=/page3.asp h=300 w=400
class=ect./div


i realize we can't have duplicate ids, but i can't figure out how to
do this any other way -- well i could by using the old onClick
function --- but I can't figure out how to do it the jquery way.

thanks for any help.




[jQuery] Validation parity client/server (was: Re: getJSON callback not firing?)

2009-09-25 Thread Scott Haneda


What do you think about getJSON for simple is username available  
type checks?


I'm thinking, go with the simple and more compact method. Return your  
errors in JSON and parse them out.


Since these are just quick exists in database lookups, the chances  
of failure are low. If they do fail, you lose the real time username  
check, but that should not matter, since when the form is fully  
posted, you are in a normal POST method, with normal client server  
validation, so the failure on the pure client side no longer matters.  
It's also the edge case, rare.


Form validation even with jQ validation plugins can quickly turn your  
code into a large set of conditions that's hard to maintain. I'm  
leaning on simpler is better.


As an aside, any suggestions on client side form validation being kept  
in parity with server side?


Consider email, username, and password validation done in jQ. That's  
three types of validation. Each has to have parity with your server  
side validation. Remembering to keep those in sync is a burden.


I would have a file that was validate.php?check=usernameuser=foo so  
one file can check all my form elements. Now when I get done on the  
client side, I'm considering using curl to fetch the same resource jQ  
did. This way my server side validation all comes from the same place.


It's an extra http call, so slower, and there's a window for some form  
of non atomic insert, although it's small, and my sites are not banks :)


Suggestions?
--
Scott
Iphone says hello.

On Sep 25, 2009, at 11:58 AM, MorningZ morni...@gmail.com wrote:


I'd suggest using the more generic $.ajax method so you can actually
catch the error, as the $.getJSON fails silently, which is no good for
programmers  :-(


[jQuery] Re: Unlock Documentation

2009-09-25 Thread Scott Haneda


I went through all the plug-ins pages last night.  There are a good  
deal, 10% maybe, that 404 or go to the wrong place.  If I go in and  
delete those, that is all I am going to be doing, deletes.  Will these  
be rolled  back since I am only deleting?  Should they even be  
deleted?  Should I try to find a new link that is not 404?  What is  
the best approach?

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 24, 2009, at 1:48 AM, Jörn Zaefferer wrote:



As Karl mentioned, users registered for more then 24h can edit all
pages, with just a few exceptions, like the wiki homepage and the
About page.

So, could you guys be a bit more specific with your critique of
existing documentation?




[jQuery] Re: simple lightbox

2009-09-25 Thread Scott Haneda


This is a quick and dirty way to show you the basics of how you may  
want to approach it.  I wrote this off the top of my head, and will  
leave positioning up to you, but the basic concepts should be there: http://dl.getdropbox.com/u/340087/Drops/09.25.09/lightbox-617a096a-225212.html

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 25, 2009, at 9:37 PM, runrunforest wrote:


I want a really simple hard coded lightbox.

Can some one teach me how to trigger a div in the center of page, if i
click the close button inside, it will close back up and if i click
somewhere outside the div, it will also close. I guess just that
simple as that.




[jQuery] Re: Unlock Documentation

2009-09-24 Thread Scott Haneda


Wow, I thought I was the only one.  Has anyone looked at the form  
validation docs?  I thought it was a wiki style though?  No one can  
edit?

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 23, 2009, at 9:21 PM, rickoshay wrote:


The documentation is going to remain in its sorry state if they do not
unlock it and allow competent technical writers to update it. There is
no excuse, for example, for not describing the copy/move behavior of
the append function. One in a mountain of necessary documentation
updates.




[jQuery] Re: Unlock Documentation

2009-09-24 Thread Scott Haneda


Sure.  I am totally new to jQ, so probably a food candidate to answer  
some of these.


http://docs.jquery.com/Plugins/Validation/validate
That through me for a loop, is this an internal feature built into jQ,  
or something I need to reference as a plugin?  I can not find an  
official answer to this.  (thank you #jquery, I am clear on this now)


It looks like there is a lot of data here:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/ and  
that MS is hosting the files, but it is not at all clear to me if this  
is officially supported.


I do not want to go into a lot of detail on that one... I used the  
milk demo as a learning base, but comparing the way that code is  
done, to the way the docs show it, is different enough that I was  
confused.  The docs do not explain why the demo is done one way, and  
the docs illustrate another.  This could just be me, not understanding  
enough of this.  So forgive me if I am way off base.


http://docs.jquery.com/Events/keypress
I spent a lot of time trying to get something like the above to work  
reliably.  The demo does not work with the delete key.  It is not  
clear if that is expected behavior, or a bug.


Unfortunately, I would have to go through each function to remember  
where I ran into a little glitch.  There are a good deal of little  
things like this that I run into:

http://docs.jquery.com/Effects/hide
I am on the demo part for hide() and click on Click to hide me too,  
the page jumps and then Hiya.Such interesting text, eh? shows up.   
That does not seem like a good hide example to me.  At least, not  
distilled down to the core example that I may want to see in order to  
understand what it does.  Looking at the source of the demo, I do not  
really understand, we have a click that creates a button, and then a  
button that does the hiding.


Duh, ok, I get it, the page jumped, and I was now in a different  
demo.  I am on a laptop, so this may not be a perfect case for your to  
replicate.  Though this is very illustrative of the type of confusion  
I run into at times.


Loving jQ, and this is in no way a knock on it, and my post was mostly  
in regards to the form validation stuff, which I do feel the docs need  
worked over.  The rest was more a comment about the OP stating that  
the docs were not wiki style editable, which you have proven to not be  
the case.  Thank you.

--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 24, 2009, at 1:48 AM, Jörn Zaefferer wrote:



As Karl mentioned, users registered for more then 24h can edit all
pages, with just a few exceptions, like the wiki homepage and the
About page.

So, could you guys be a bit more specific with your critique of
existing documentation?

Jörn

On Thu, Sep 24, 2009 at 7:57 AM, Scott Haneda talkli...@newgeo.com  
wrote:


Wow, I thought I was the only one.  Has anyone looked at the form  
validation

docs?  I thought it was a wiki style though?  No one can edit?
--
Scott * If you contact me off list replace talklists@ with scott@ *

On Sep 23, 2009, at 9:21 PM, rickoshay wrote:

The documentation is going to remain in its sorry state if they do  
not
unlock it and allow competent technical writers to update it.  
There is

no excuse, for example, for not describing the copy/move behavior of
the append function. One in a mountain of necessary documentation
updates.






[jQuery] Suggestions on form validtion

2009-09-20 Thread Scott Haneda


Hello, I created this:
http://dl.getdropbox.com/u/340087/Drops/09.20.09/form-e3ae8599-180653.html

The basics are that jQuery will immediately hide a div that is the  
right most column.

$('div.right').hide();

I have three input elements that when focus is given, I take the  
next() element, which is the right div, and fade that in.


On blur, I take the next element, and set it back to hidden.  This  
works well, and accomplishes what I want in as minimal code as I am  
able to hobble together.


Next, I need to validate the fields, so working on user and name  
in this case, leaving email for later, since it will be more complex.


If the string length of user is more than 1, I want to drop a new  
class to show to the right of the input.  It would say OK and change  
the background color to green.  If the string is less than 1, it would  
say invalid and change the background to red.


Similar treatment to name and email of course, just different  
conditions.  Using string length of 1 for simplicity, I will probably  
do (foo = 5) or something like that.


I have not been able to get this to work, and I also do not want to  
add a lot of code for the validation.


Suggestions on the correct process?  How is my current approach?
--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: (validate) email validator

2009-09-15 Thread Scott Haneda


Right, this is sort of a long debate, which I see pop up on mailing  
lists for email servers.  In the end, I think you need to go by the  
standards.


Just because hotmail breaks the rules, does not mean you want to  
punish some other user who does not use hotmail, just because they use  
a character in their email address that hotmail does not.


On Sep 14, 2009, at 6:04 PM, Sean McKenna wrote:


While technically this is correct, a more restrictive approach might
be preferable because some email services (hotmail for one) will not
send to an email address using anything other than alphanumerics,
dots, hyphens, and underscores.


--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: (validate) email validator

2009-09-14 Thread Scott Haneda


The one letter for tld is probably a bug.  The characters you list are  
legal to the left if the last @ sign.


--
Scott
Iphone says hello.

On Sep 14, 2009, at 10:59 AM, mattso matthieu.larc...@gmail.com wrote:



How come the validator for emails only needs one letter for the tld
and allows non valid characters like / or * ?


[jQuery] Re: missing background-image

2009-09-13 Thread Scott Haneda


Look at the network panel in firebugs or activity monitor in Safari.  
See what URL is being requested for the images. You can then see where  
there error in your path is.


--
Scott
Iphone says hello.

On Sep 12, 2009, at 11:10 PM, macsig sigbac...@gmail.com wrote:



Hello guys,
I have a series of divs (all with the same CSS class) and I'm trying
to add dynamically a background image to each one (each div needs a
different image) so here my code

$('.panel').css({'background-image' : 'url(../images/sub/'+ $
(this).attr(id) +'.png)'});

but unfortunately my divs don't have any background; however if I
hardcode a image, for instance

$('.panel').css({'background-image' : 'url(../images/sub/bg1.png)'});

every div has the (same) background.

Finally if I print out the image path for each div

$('.panel').each(function(){
alert('url(../images/sub/'+ $(this).attr(id) +'.png)'});
});

the path looks fine.


Am I missing something???

THANKS

Sig


[jQuery] Re: Suggestions on file upload with image cropping

2009-09-12 Thread Scott Haneda


Anyone; can I get some love :)

--  
Scott

Iphone says hello.

On Sep 11, 2009, at 2:24 PM, Scott Haneda talkli...@newgeo.com wrote:



I have been poking around at the various file upload solutions.   
Wondered what people here had to say about which are the best.


I am looking for single file upload, to image crop.  I would like to  
use jCrop, so anyone that has experience implementing that with it,  
let me know what you chose.


About my only criteria is going to be that I will want to style the  
upload input element, so that may not even be Jquery related, and  
just the usual CSS tricks.  From there, I suspect I just pass some  
ajax mafic on it, and the params get passed along.


I looked at uploadify http://www.uploadify.com/ and while I am sure  
it is a great tool, I am not looking to use a flash based plugin.   
Also, in looking over their docs, it appears to me they are trying  
to cater to being the end all of upload plug-ins.  I am hoping to  
find something pretty lean, and just doing the bare minimum of file  
uploads, with perhaps a progress bar.


If anyone knows of implementations with the apache upload status  
module, that would be even better.


Thanks for any suggestions, I thought I would ask since I am sure  
many of you have been down this road before.


* I have done server side file uploads using GD to scale, crop,  
compress, and effect an image, so I am not too worried about the  
server side of this, I should be able to handle that as long as I  
can pass the upload, and pass x, y, w, and h from the crop.


Thank you
--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Suggestions on file upload with image cropping

2009-09-11 Thread Scott Haneda


I have been poking around at the various file upload solutions.   
Wondered what people here had to say about which are the best.


I am looking for single file upload, to image crop.  I would like to  
use jCrop, so anyone that has experience implementing that with it,  
let me know what you chose.


About my only criteria is going to be that I will want to style the  
upload input element, so that may not even be Jquery related, and just  
the usual CSS tricks.  From there, I suspect I just pass some ajax  
mafic on it, and the params get passed along.


I looked at uploadify http://www.uploadify.com/ and while I am sure it  
is a great tool, I am not looking to use a flash based plugin.  Also,  
in looking over their docs, it appears to me they are trying to cater  
to being the end all of upload plug-ins.  I am hoping to find  
something pretty lean, and just doing the bare minimum of file  
uploads, with perhaps a progress bar.


If anyone knows of implementations with the apache upload status  
module, that would be even better.


Thanks for any suggestions, I thought I would ask since I am sure many  
of you have been down this road before.


* I have done server side file uploads using GD to scale, crop,  
compress, and effect an image, so I am not too worried about the  
server side of this, I should be able to handle that as long as I can  
pass the upload, and pass x, y, w, and h from the crop.


Thank you
--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: something amiss with json call/file

2009-09-11 Thread Scott Haneda


Maybe your use of appendTo is wrong, I just did this test:

$.getJSON(http://www.pomona.edu/dev/home/spotlight.json;,
function(data){
$.each(data.items, function(i, item){
$(div).append(i);

});
});

div id=images/div

I got 01234, so the index of each item in your JSON.  With that, you  
know your JSON is ok, and you need to look at what appendTo is not  
working.


Sorry I can not be of more help, this is about day 2 of Jquery for me.

On Sep 11, 2009, at 3:56 PM, roryreiff wrote:


I have the following code:

   // pull in json feed and inject panes into page
$.getJSON(http://www.pomona.edu/dev/home/spotlight.json;,
   function(data){
$.each(data.items, function(i,item){
$('div 
class=\pane\/div').appendTo('#spotlight-panes');
});
});

and I cannot figure out what is going wrong. As you can see, I am not
even trying to do anything yet with the json data, but assuming that I
should still be seeing some divs injected into the DOM. Wondering if
there is something wrong with my JSON file? Any help is
appreciated...I just can't figure out what is going on! Code in effect
here: http://pomona.edu/dev/home/index.asp Thanks,


--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: Limiting character input, also displaying input fields contetns

2009-09-08 Thread Scott Haneda


Sorry to bump this one. I seem to have a problem with chosing complex  
things as a first try learning experience.


Due to the time sensitive nature of the project I am working on, if I  
can not solve this here, where is a suggested freelance forum that  
advanced JQ folks hang out in?


--
Scott
Iphone says hello.

On Sep 7, 2009, at 9:24 PM, Scott Haneda talkli...@newgeo.com wrote:



Here is a test link:
http://dl.getdropbox.com/u/340087/Drops/09.07.09/user-21bbf008-212305.html

There is a good deal going on I am not able to solve, delete key  
being one of them. I can not keep the span updated as I want to.  I  
suspect because the function returns false in order to block the key  
entry.


On Sep 7, 2009, at 8:31 PM, Scott Haneda wrote:


I have a pretty basic set of things I want to do:

Capture key press, compare against an allowed list, block keys that  
are not in that list, replace a space by a dash if entered.


As this is happening, I have a span I wanted to be updated with the  
live values.  The username field at https://twitter.com/signup is  
exactly what I am trying to do, though I have trouble dissecting  
how they did it.


Here is my attempt, which is off by one keypress for some reason.   
Any help is appreciated.  Using 1.3.2 JQ.


--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Limiting character input, also displaying input fields contetns

2009-09-07 Thread Scott Haneda


I have a pretty basic set of things I want to do:

Capture key press, compare against an allowed list, block keys that  
are not in that list, replace a space by a dash if entered.


As this is happening, I have a span I wanted to be updated with the  
live values.  The username field at https://twitter.com/signup is  
exactly what I am trying to do, though I have trouble dissecting how  
they did it.


Here is my attempt, which is off by one keypress for some reason.  Any  
help is appreciated.  Using 1.3.2 JQ.


script type=text/javascript charset=utf-8
$(document).ready(function() {
 $('input#the-name').bind('keypress', function(e) {
  console.log('keycode: ' + e.which + ' actual: [' +  
String.fromCharCode(e.which) + ']');


  // Limit characters that can even be pressed
  var c = String.fromCharCode(e.which); // Actual character  
pressed on keyboard
  var allowed =  
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890- ';

  // if we do not find actual letter in the list, stop.
  if (e.which != 8  allowed.indexOf(c)  0) return  
false; // 8 is backspace


 })

 $('#the-name').keypress(function() {
  var entered = $('#the-name').val();
  $('#live').text(entered);
  console.log(entered);
 });
});
/script

html parts:
input type=text name=the_name value= id=the-name  
autocomplete=off /br /

http://example.com/span id=live/spanbr /
--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: Limiting character input, also displaying input fields contetns

2009-09-07 Thread Scott Haneda


Here is a test link:
http://dl.getdropbox.com/u/340087/Drops/09.07.09/user-21bbf008-212305.html

There is a good deal going on I am not able to solve, delete key being  
one of them. I can not keep the span updated as I want to.  I suspect  
because the function returns false in order to block the key entry.


On Sep 7, 2009, at 8:31 PM, Scott Haneda wrote:


I have a pretty basic set of things I want to do:

Capture key press, compare against an allowed list, block keys that  
are not in that list, replace a space by a dash if entered.


As this is happening, I have a span I wanted to be updated with the  
live values.  The username field at https://twitter.com/signup is  
exactly what I am trying to do, though I have trouble dissecting how  
they did it.


Here is my attempt, which is off by one keypress for some reason.   
Any help is appreciated.  Using 1.3.2 JQ.


--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: Form Serialize - Not replace space with plus

2009-09-04 Thread Scott Haneda


Encode the URL string prior to submitting? This is almost always the  
safest method. Just decode it server side. With all encoded  
characters, JQ has nothing it need add +'s to.


--
Scott
Iphone says hello.

On Sep 4, 2009, at 1:19 PM, Aaron Kreider aa...@campusactivism.org  
wrote:




I'm using $(form).serialize(), and then doing an AJAX request.

JQuery automatically replaces spaces with the + character.

How can I keep my spaces?

(I couple replace the + character with a space on the server side, but
I want the users to be able to enter the + character when they submit
forms.)


[jQuery] Re: Is this quirk of jQuery still true?

2009-09-02 Thread Scott Haneda


This is an intersting problem though. Without the ability to edit the  
HTML, a page refresh is going to kill any work you did.


Granted, in most cases, the need for a page refresh would not matter,  
as the browser is going to drop the input form data anyway.


One advantage would be you could potentially store the form data.

As web apps become more complex, it may not be form data, but  
positioned elements.


What is the best way to save this state in hopes of protecting the  
user from a refresh? Is it even worth it?


I can see three ways. Local browser data store, not currently  
supported by all browsers.


Second is appending to a refresh link, or the URL directly, some data  
that can store the last state.


Third is use of cookies to store state.

Curious what others chose to use in solving this, or if it is even  
something considered a problem worth solving.


--
Scott
Iphone says hello.

On Sep 2, 2009, at 7:29 PM, Rick Faircloth  
r...@whitestonemedia.com wrote:



Thanks for the reply, Ricardo...

After thinking about it, it really doesn’t matter if the HTML is cha 
nged.

It'll process fine, as you said.

What I was really trying to avoid was a problem with the newly entered
data being removed if I focused on the field with the cursor again.

I came up with a better solution that deleted the error message I put
into the field, but didn't delete the new typed in code.


[jQuery] Appending to a static string

2009-08-27 Thread Scott Haneda

Hello, as an example, https://twitter.com/signup when you enter in a  
username, a static string of Your URL: http://twitter.com/USERNAME;  
has the USERNAME replaced with what you are typing in.

This is day one of JQ for me. I was looking at the onkeyup event in JS  
in general, but I figure it is time for me to learn JQ.

I am pretty sure I am going to
   script type=text/javascript
 $(document).ready(function(){
// something fancy here
 });

html...
div
Your URL: http://example.com/USERNAME
div

Any help is appreciated.
-- 
Scott * If you contact me off list replace talklists@ with scott@ *