[jQuery] persistent select through pages in data grids

2009-04-13 Thread Saurabh

Hi,

I am evaluating various javascript based datagrid that i can use in my
application.

I want to know if its is possible that row selection persists across
the page change. e.g.

I select row 2,5,7 on page 1 and then i change to page 2 and select
20,25. I go back to page one ... will i get 2,5,7 pre selected ?

OR

is scroll pagination possible . by scroll pagination i
mean AJAX loads more data when i have scrolled to last row. kind of
auto pagination

Thanks  Regards,
saurabh


[jQuery] jQuery can't catch 302 status in IE, but works in Firefox

2009-04-13 Thread chris

To keep the story short :

After every AJAX call, I want to check the status. If the status is
302 (redirect), I want my AJAX to redirect to an URL set on Location
header.
My code is like this :

div id=session_timeout_gtbportal /div
script type='text/javascript'


jQuery(#session_timeout_gtbportal).ajaxComplete(function(event,
request, settings){
alert(request.status);
if(request.status==302){
alert(302 inside);

location.href=request.getResponseHeader(Location);
return false;
}
});
/script

In Firefox, 302 status can be catch perfectly (  alert(302 inside)
will be executed ), and browser can redirect to location specified by
Location header. But in Internet Explorer ( I use IE 7),  alert(302
inside) is never executed. I always get 200 as status-code. I use
jQuery 1.2.6.

Anyone can help me with hint /idea how to make IE to behave exactly
the same like Firefox ?
Thank you


[jQuery] Re: Plugin Development

2009-04-13 Thread Spot


Anyone else able to shed some light on this?

Spot wrote:


Nathan,

Ok, I am aware of the base use of each() (been coding in PHP for about 
eight years), but I cannot see how it is viable in this case.


Making a long story short...

This plug-in is a selector(auto-completer). To be more specific, it is 
several selectors. I have a specific plugin for each selector, and am 
$.extend()ing a base (external) DataSelector class, which has the 
boilerplate functionality (pulling data, building DOM elements, 
handling arrow keys, etc), and the plugins only have code specific to 
that data type.


The problem I am having, is that even when using two different 
plugins, I get namespace conflicts (e.g. the last called plugin on the 
page, overwrites the namespace for all the previous).


Ok, now because I am specifically hooking the plugin to only _one_ 
element each time, I cannot see how each() is helpful. Unless it needs 
to somehow return the one element with an index.


Does this make sense?

Again, I appreciate your assistance greatly.

Thanks!

Nathan wrote:

Yeah, Copy/paste gets ya no where for sure.

For each() you should check out: http://docs.jquery.com/Core/each
Which states: Execute a function within the context of every matched
element

From my previous example, this.each() is the same as saying:

$('#divNameHere').each();

So that runs your plugin only within that element.

So this:
$('#nav a', obj).click(function(){
$('#someDiv').fadeIn();
})

Is also this in each instance:
$('#divNameHere #nav a').click(function(){
$('#someDiv').fadeIn();
})

So it's changing out what '#divNameHere' is depending on what elements
you are applying your plugin to.

Hopefully that helps answer your question.

If you're not already. Use Firefox with Firebug and put something like
console.log('this is: ', this); in your plugin within the this.each()
funciton. Firebug then will log what this is in each instance. And FYI
console.log will give you a JS error in IE so comment it out before
testing in IE.








On Apr 7, 2:58 pm, Spot s...@napalmriot.com wrote:
 

Nathan, first off, thank you for responding.

I understand about passing the obj as scope. That makes perfect sense.
However I am a little confused as to the purpose of returning 
this.each.

What is the goal there?

I find it better to understand why something works, as opposed to just
copy/pasting. It saves everyone time in the long run. :)

Thanks again!



Nathan wrote:

   

To do this you need to have return this.each and optionally change
the instance of this which is the name of the object you are apply
the plugin to, to obj using var obj = $(this);.
  Then when you call a selector, you'll need to add $('#nav 
a', obj)

note the , obj.
  This will keep it within the name space of what ever selector 
you

apply this to when the plugin is initialize.
  (function($){
   $.fn.extend({
   plauginNameHere: function() {
   return this.each(function() {
   var obj = $(this); // this just changes 
the use of 'this' to obj

 $('#nav a', obj).click(function(){
   $('#someDiv').fadeIn();
   });
 })
   }
   });
})(jQuery);
  On the page level you will then need to initialize the plugin 
on the

HTML page level.
  script type=text/javascript charset=utf-8
   $(function(){
   $('#divNameHere'). plauginNameHere(); // first instance
   $('#secondDivNameHere'). plauginNameHere(); // second 
instance

   });
/script
  So what ever the selector name is above, for example
#secondDivNameHere, will then be the 'this' that we changed to 'obj'
using a var in plugin script. So in this example the plugin's obj is
#secondDivNameHere.
  Let me know if that helps.
  On Apr 6, 1:44 pm, Spot s...@napalmriot.com wrote:
 

How would one develop a plugin which can exist multiple times on the
same page, without conflicting with each others namespaces?



  


[jQuery] Re: simple query does not work

2009-04-13 Thread dongle

thank you ricardo,that was helpful.

On Apr 13, 6:42 am, Ricardo ricardob...@gmail.com wrote:
 .get(0) returns a DOM element, not a jQuery object, so the .css method
 doesn't exist in it. Try this:

 $(div#photolinks img).eq(0).css(border,5px solid black;);
 or
 $(div#photolinks img:first).css(border,5px solid black;);

 On Apr 12, 8:03 pm, dongle tetri...@gmail.com wrote:

  nop, there are too get ; one that acts like the javascript index(i)
  method:http://docs.jquery.com/Core/get
   i am referring to that one, :first would not help me here.

  On Apr 13, 12:57 am, Chuck Harmston cpharms...@gmail.com wrote:

   I'm not quite sure what you're trying to do here. The $.get() function is
   used to submit an HTTP GET request. See:

  http://docs.jquery.com/Ajax/jQuery.get

   Are you trying to return the first response? Try using $(div#photolinks
   img:first).

   Chuck Harmstonhttp://chuckharmston.com

   On Sun, Apr 12, 2009 at 5:41 PM, dongle tetri...@gmail.com wrote:

i am making this(it does not work) :

$(document).ready(function(){

 $(div#photolinks img).get(0).css(border,5px solid black;);

});

if i do this:

$(document).ready(function(){

 $(div#photolinks img).css(border,5px solid black;);

});

it does work, whats wrong?
thanks


[jQuery] problem handling mouseover event

2009-04-13 Thread mcologne

hi,

i have several images (more icons) on the page where i want to show a
div like a tooltip with more links on mouseover of these images.

the class of these images is .but_plus

i have a div before body for the tooltip

div id=navoverhere are more links/div

.but_plus{
position:relative;
z-index:5;
}
#navover{
position:absolute;
display:none;
width:200px;
height:100px;
z-index:1;
background-color:#cc;
}

the z-index of the images is higher than the overlay, because the
image should be visible in the left top edge of the overlay even when
the overlay is visble.

my problem is in handling the mousover events

$(document).ready(function(){
$(.but_plus).mouseover(function(){
  $(#navover).hide();
  var pos = $(this).offset();
  var posleft = pos.left;
  var postop = pos.top;
  $(#navover).show();
  $(#navover).css({'top' : postop, 'left' : posleft});
  $(#navover).mouseout(function(){
$(#navover).hide();
});
}).mouseout(function(){
 //still empty at this time
});
});

anybody an idea how to handle the events in this case... my problem
actually is, that the overlay doesn't disappear when i shortly move
the mouse over the image and directly out (top or left direction)

if i attach an mouseover and out (or enter leave, hover) to the image,
i have no idea how to handle the display of the overlay... i don't
know if the user leavs the image eg. in the top direction or the
bottom direction... in the last case the overlay must be shown

best regards m
cologne


[jQuery] Re: Help, friends!

2009-04-13 Thread rusllangashik
i can't find anything. but i realize that tag clouds - i take script
from 4dle by IE! Thanks all!

On 13 апр, 01:26, dongle tetri...@gmail.com wrote:
 Google это ваш лучший друг.
 пока!

 На 12 апреля, 1:13 утра, rusllangashik online...gmail.comписал:

 - Скрыть цитируемый текст --

 - Показать цитируемый текст --



  Привет всем

  Мне нужно реализовать облако тегов в стиле, как это делается здесь - 4dle.ru
  (Русский сайт). Я khow оно jQuery! Может некоторым дать мне скрипт для 
  реализации
  Так ли? Пожалуйста!

[jQuery] Re: truncate problem - why does it show full-size and then shrink after page load?

2009-04-13 Thread Andy

Any thoughts on this?

On Apr 9, 12:03 pm, Andy andym...@gmail.com wrote:
 I'm using the Truncate plugin (http://www.reindel.com/truncate/) and
 when the page loads, all the DIVs display full size and then after the
 page load, they all shrink and show the more link.

 I look at the example on the Truncate site and it doesn't behave this
 way

 Any ideas?


[jQuery] preloading a div

2009-04-13 Thread Sasser

hi

i'm new to jquery and got a problem concerning the preloading of
content.
before changing the content dynamically i want to fade it out. so i
tried this:

$(#div).fadeOut();
$(#div).load(url);
$(#div).fadeIn();

this works quite good. there is just the problem that the content
fades in immediately after fading out - there is no time for the
loading of content.

a guy in the irc-channel told me to use a callback function... but i
do not really understand :(

can anyone help me?
thanks!


[jQuery] Re: Cycle plugin Issue in Safari and Chrome browser

2009-04-13 Thread t3k...@web.de

I have the same issue with Chrome.
I just tried the newest version of Cycle but the problem is still
there.
Wrapping the cycle div in another one fixes the problem but that seems
not really the way to go.

The code goes something like:

div class=slideshow
div class=slideimg src=slide1.jpg alt= title=brdiv
class=textbackgroundnbsp;/divdiv class=slidetext/div/
div
div class=slideimg src=slide2.jpg alt= title=brdiv
class=textbackgroundnbsp;/divdiv class=slidetext/div/
div
/div


and the css:

.slideshow{
width:680px;
height:250px;
}

div.slidetext {
height:20px;
width:680px;
display:block;
margin-top:-25px;
margin-left:15px;
position:absolute;
}
div.textbackground {
display:block;
height:30px;
width:680px;
opacity:0.7;
margin-top:-30px;
position:absolute;
}

and both the height and the width of .slideshow are not recognized in
Chrome (but work fine in IE and FF).




[jQuery] Re: New jQuery plugin LoopedSlider. Looking for feedback

2009-04-13 Thread krisbfunk


Yes! I've been looking everywhere for this type of content slider. I too am
wedded to the serialscroll plugin, which allows for animation of images in a
continuous linear scroll, (with the aid of the easing plugin), but then
there's the naggy rewind... is it also possible to do this with yours, but
with a continuous loop of images instead of a rewind? 



Nathan-77 wrote:
 
 
 Yeah I know, another content slider, there are way too many. But I've
 wanted something that looped from first to last or last to first slide
 using next/previous buttons and that fades if you click on a slide
 number. So that's why I've created this plugin.
 
 Would love some code feedback if anyone has a moment to take a look. I
 appreciate any advice or criticism.
 
 loopedSlider, a jQuery plugin:
 loopedSlider is a plugin made for jQuery that solves a simple problem,
 the looping of slide content. It was created to be easy to implement,
 smooth and most of all end the content rewind that most other
 content sliders suffer from.
 
 http://code.google.com/p/loopedslider/
 
 

-- 
View this message in context: 
http://www.nabble.com/New-jQuery-plugin-LoopedSlider.-Looking-for-feedback-tp22913018s27240p22982108.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jquery form.ajaxSubmit under http redirect (302)

2009-04-13 Thread Vinod B

hi,
I am doing a form.ajaxSubmit, the response of which is content type
text/javascript that will be eval'ed on the client.
The ajaxSubmit uses the post method to post the form values. The
server does a redirect by sending http response 302 and the new URL
redirected to, returns the above text/javascript. For some reason, on
Firefox, the javascript response is not eval'ed. This works fine on
IE.

So has anyone encountered this problem of how jquery form.ajaxSubmit
behaves on an http 302 redirect?

I passed the appropriate ajax options object to the ajaxSubmit
function but none of them got called either. The ajax options set
were:
$(form).ajaxSubmit({beforeSubmit: function (){alert ('before
submit');}, error: function () {alert ('error'); console.log
('error');}, complete:function (XMLHttpRequest, textStatus) {alert
('completed'); console.log ('complete');}, success:function()
{console.log ('success'); alert ('Thanks for submitting');}});}

thanks,
-vinod


[jQuery] preloading a div

2009-04-13 Thread Sasser

hi

i'm new to jquery and got a problem concerning the preloading of
content.
before changing the content dynamically i want to fade it out. so i
tried this:

$(#div).fadeOut();
$(#div).load(url);
$(#div).fadeIn();

this works quite good. there is just the problem that the content
fades in immediately after fading out - there is no time for the
loading of content.

a guy in the irc-channel told me to use a callback function... but i
do not really understand :(

can anyone help me?
thanks!


[jQuery] how to call 1 function from many buttons by passing parameters

2009-04-13 Thread HISSAM

Hey I'm new to JQuery

I have 5 divs
At a time only 1 div should be expanded the others must be hidden

I'm using the show and hide function
But I want to function parameterised to open the respective div and
hide the other which is open

How do I go about ??


[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread Lwangaman

I tried working on it again and made a little progress... Now I got
parent and child selected correctly, but I don't have mouseover
working for some reason...

http://jsbin.com/avigi/edit

On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:
 One more detail: mouseout should not take effect until mouseup.
 In fact, right now, if I click and begin to drag, then still holding
 the mouse button I leave the area, and still holding it come back over
 the cells, they no longer get checked / unchecked because mouseout has
 already kicked in. Instead it shouldn't kick in until I actually let
 go of the mouse button, and I could let go of it anywhere on the page
 I suppose, so I guess mouseup would have to be applied to the whole
 document.

 On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

  I tried something along those lines...

 http://jsbin.com/ehedu/edit

  But I just don't have the hang of using this correctly and knowing
  when to refer to dom elements as dom elements or as jquery objects...

  The idea is to tie all events to the container of the checkboxes (i.e.
  table cells), and not to the external container (table or ul list or
  whatever), and yet be able to read and write the value of the
  checkboxes...

  On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

   Taking up jscripter's suggestion, I just noticed myself that applying
   the mousedown and mouseover to the whole table keeps you from being
   able to click on any links that may be contained in the table. For
   example my table has links in the header cells that when clicked
   reorder the table according to that column. Now I can no longer click
   them...
   And, as jscripter says, in the X-Library the mousedown and mouseover
   was applied to the cells containing the checkboxes and not to the
   checkboxes themselves, so that it was enough to click on the cells
   surrounding the checkboxes in order to get them checked / unchecked.

   Ricardo do you think you could manage something like that? (I'm only
   an apprentice and I don't have your expertice!)

   On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

Hey - this is great work - I just happened to be looking for this
functionality.

How would you apply what you have done here to re-writing the original
X-library code that uses TDs for the checkbox label?

Thanks!

On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

 Sure! I have a few other plugins I also want to upload, I'll do that.

 I took the time to rewrite it more carefully. No more binding/
 unbinding, a single var, all namespaced and bugs ironed out (if you
 put the cursor away while holding the button, the mouseover would
 remain active even after mouseup).

 The advantage of namespacing is you can easily remove all event
 handlers. I included that in the plugin, in the example you can use $
 ('ul').dragCheck(false) to disable it completely.

http://jsbin.com/amoxi/edit

 cheers,
 - ricardo

 On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

  @Ricardo
  Do you think it could be useful to add this to the jquery plugins at
  plugins.jquery.com? I'd say it could be put under your name because
  you did all the big work!

  On 12 Apr, 14:35, Lwangaman donjohn.f...@gmail.com wrote:

   Ok that works better, I just changed clicked.checked = 
   !isChecked to
   clicked.checked = isChecked:

  http://jsbin.com/idihi/edit

   On 12 Apr, 08:11, Ricardo ricardob...@gmail.com wrote:

The problem with your fix is that the event target for the 
mouseup is
not the same as the mousedown. You can resolve that by saving 
the
clicked checkbox in a var, and because of event order the 
change has
to be made on 'click' rather than mouseup.

   http://jsbin.com/asizu/edit

Sorry for the bugs, this was written rather quickly, I hope it 
works
now :)

On Apr 11, 11:30 am, Lwangaman donjohn.f...@gmail.com wrote:

 Ok I tried to touch up the code a little to fix that, here's 
 my
 example:

http://jsbin.com/iyubi/edit

 Now, with a single click, the value on mouseup is reversed to 
 keep it
 as it was with mousedown. But, when you do a drag, the 
 mouseup of the
 last checkbox is not canceled or reversed... I suppose it 
 would be
 enough to cancel $(this)'s mouseup, but how would you refer 
 to $(this)
 from within the $boxes.bind('mouseover')?

 On 11 Apr, 16:07, Lwangaman donjohn.f...@gmail.com wrote:

  Hmm, just noticed one problem though... A single click on a 
  checkbox
  is supposed to work too, but with this code as soon as you 
  mouseup the
  value goes back the other way... You have to drag off in 
  order to keep
  the 

[jQuery] Re: how to call 1 function from many buttons by passing parameters

2009-04-13 Thread Eric Garside

Take a look at the jQuery UI Accordion plugin.

http://ui.jquery.com

On Apr 13, 6:30 am, HISSAM hissam.sher...@gmail.com wrote:
 Hey I'm new to JQuery

 I have 5 divs
 At a time only 1 div should be expanded the others must be hidden

 I'm using the show and hide function
 But I want to function parameterised to open the respective div and
 hide the other which is open

 How do I go about ??


[jQuery] Re: Works in IE7 but not IE6

2009-04-13 Thread slycreations

My suggestion was that you may want to make sure that your jQuery
scripts and/or plug-ins are encoded as UTF-8.
To do that, you would need to open and save each script file using
UTF-8 encoding.

File encoding may not be the issue at all.  I've been unable to tell
from your post if the problem is with jQuery itself or with a plug-in
script.

Have you verified if jQuery is running at all in IE6?  For example,
create a new page and insert a simple jQuery action that would let you
know if it's running  (such as an alert message).


[jQuery] jQuery multiple toggle - should be quick

2009-04-13 Thread Daniel

I have multiple divs called article which have a show/hide link to
toggle a div inside called articleBody. Problem is when I click the
link all divs show/hide.

The html structure is below:

div class=article
p class=showa href=#Hide [-]/a/p
div class=articleBody!-- Stuff i need to hide on click/div
/div

Any idea how I can change the toggle the text in show as well as just
closing that one instance of div article rather than every instance on
the page?

Thanks


[jQuery] Re: preloading a div

2009-04-13 Thread errant

In computer programming, a callback is executable code that is passed
as an argument to other code. - 
http://en.wikipedia.org/wiki/Callback_(computer_science)

This will probably work for you:

$(#div).fadeOut(function(){
  $(#div).load(url, function() {
$(#div).fadeIn();
  });
});

http://docs.jquery.com

On 13 апр, 11:55, Sasser maik.tai...@googlemail.com wrote:
 hi

 i'm new to jquery and got a problem concerning the preloading of
 content.
 before changing the content dynamically i want to fade it out. so i
 tried this:

 $(#div).fadeOut();
 $(#div).load(url);
 $(#div).fadeIn();

 this works quite good. there is just the problem that the content
 fades in immediately after fading out - there is no time for the
 loading of content.

 a guy in the irc-channel told me to use a callback function... but i
 do not really understand :(

 can anyone help me?
 thanks!


[jQuery] Re: Validation plugin remote problem

2009-04-13 Thread Jörn Zaefferer
Could you post a testpage? Can't see anything wrong in the snippets
you provided - its probably something seemingly unrelated.

Jörn

On Sun, Apr 12, 2009 at 4:18 PM, Victorr victor.ry...@gmail.com wrote:

 Ok. But what do i need too echo to get a false value and an error
 message?

 thanks!

 On 12 Apr, 10:37, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 You need to echo true for a valid value.

 Jörn

 On Sun, Apr 12, 2009 at 1:02 AM, Victorr victor.ry...@gmail.com wrote:

  I'm using CakePHP, jQuery and the validation plugin. I'm having some
  problems. I'm trying to check if a email is already in use but I can't
  seem to get it too work.

  I'm just trying to get a error message to see that it works but I
  can't seem to get it right.

  Javascript:

  $(document).ready(function() {
         $(#UserIndexForm).validate({
                 rules: {
                         data[User][email]: {
                                 required: true,
                                 email: true,
                                 remote: /
                         },
                         data[User][passwrd]: {
                                 required: true,
                                 minlength: 5
                         },
                 },
                 messages: {
                         data[User][email]: {
                                 required: Du måste ange en e-post adress.,
                                 email: Du måste ange en giltig e-post 
  adress.,
                                 remote: E-post adressen du angav är 
  upptagen.
                         },
                         data[User][passwrd]: {
                                 required: Du måste ange ett lösenord.,
                                 minlength: Ditt lösenord måste vara minst 
  5 tecken.
                         }
                 }
         });
  });

  And the controller:

                 if ($this-RequestHandler-isAjax()  
  !empty($_REQUEST['data']
  ['User']['email'])) {
                         $valid = 'false';
                         echo $valid;
                 }

  Thanks!


[jQuery] Slider for Gallery

2009-04-13 Thread iceangel89

i am intending to do a slider for my gallery.

something like i show just 3 images 1st then have a prev  next button
to slide the gallery left or right to the next 3 (or 1) items. i hope
u can visualize this, i think a common effect.

then for a nicer effect. say i allow user to skip to a image. say i
show items 1-3, i wanna view item 23. so i shld speed and ease in/out
to that. how can i do this? any plugins or i need to do 1 myself? any
suggestions or directions?


[jQuery] Re: jcarousel and text below image

2009-04-13 Thread globalpropertyonline....@gmail.com

Hi Jay,

Hope you had a good Easter Weekend. Any more help on my previous post
will be much apreciated as I am still stuck with the same thing.

Thanks in advance for your help.

Hugo

On Apr 11, 8:36 am, globalpropertyonline@gmail.com
globalpropertyonline@gmail.com wrote:
 Thanks for the response Jay.

 I have now added the function as follows in the head and tried the
 following two lines at three different places but still no luck. The
 errors seems to have gone away now , but I do not see the Bla.

 div = $(div style='display:none'blah/div);
 $(document.body).appendChild(div);

 1) I have put the two lines in the function but no luck,
 2) I have put the two lines in the fuction below the Return HTML Get
 Element but no luck.
 3) I have put it in its own javascript tags below the declaration of
 the div as it is but no luck.

 This is the function now in the head. You can see my code source 
 here.http://www.somewhere2rent.com/test/

 I have also made the image smaller just in case the text is behind the
 image.

 script type=text/javascript

 $(function()
 {
 whatever(); {

 jcarousel.find(img)
 .hover(
 function(){
 div.css({display:'block',position:'absolute',left:$(this).offset
 ().left, top:$(this).offset().top+$(this).height()});

 },

 function(){
 div.css({display:'none'});

 });
 },
 });

 /script

 body

 div id=wrap align=center

 script type=text/javascript

 div = $(div style='display:none'blah/div);
 $(document.body).appendChild(div);

 /script

   ul id=mycarousel class=jcarousel-skin-ie7
     !-- The content will be dynamically loaded in here --
   /ul

 /div

 /body
 /html

 ANy more help will be apreciated.

 Thanks

 On Apr 11, 4:29 am, brian bally.z...@gmail.com wrote:



  There's no need for body onload= when using jquery. As long as the
  library is included, you need only do:

  $(function()
  {
          whatever();

  });

  Here, the whatever() function will run as soon as the DOM is loaded
  (generally, this occurs before the page is displayed).

  On Fri, Apr 10, 2009 at 11:07 PM, globalpropertyonline@gmail.com

  globalpropertyonline@gmail.com wrote:

   Thanks Jay,

   I have put a function Load() in the head and called it in body onload.
   and then add the two lines in Javascript justbelowthe Div is
   declared but it seems to have a javascript error and no Bla is
   displayed.

   I tried to change a few things but no luck.

   This is what I have done.

   script type=text/javascript
   function load()
   {

  jcarousel.find(img)
   .hover(
   function(){
   div.css({display:'block',position:'absolute',left:$(this).offset
   ().left, top:$(this).offset().top+$(this).height()});
   },

   function(){
   div.css({display:'none'});
   });

   }
   /script

   /head

   body onload=load()

   div id=wrap align=center

   script type=text/javascript

   div = $(div style='display:none'blah/div);
   $(document.body).appendChild(div);

   /script

    ul id=mycarousel class=jcarousel-skin-ie7
      !-- The content will be dynamically loaded in here --
    /ul

   /div

   On Apr 11, 12:49 am, jay jay.ab...@gmail.com wrote:
   You can put it at the very bottom and wrap it with script tags, or
   you could put it in the head in script tags like this:
   head
   script
   $(function(){
   ..onload code goes here..});

   /script
   /head

   Also $(document.body).appendChild(div); can go after the div is
   declared instead.  I would suggest you perhaps read some books/
   tutorials on javascript and/or jquery to learn more.  It is very
   different from ASP since ASP is server-side code and javascript is
   client-side.

   On Apr 10, 4:01 pm, globalpropertyonline@gmail.com

   globalpropertyonline@gmail.com wrote:
Me again

I tried your code here like this. but it does not seem to work. Any
pointers ???

script type=text/javascript

function mycarousel_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i = carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i  mycarousel_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList
[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
   }

};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    var url_m = item.url.replace(/_s.jpg/g, '_m.jpg');

    return 'a href=' + url_m + ' title=' + item.title + '
myrefval=' + item.myref + ' mydescval=' + item.mydesc + '
myCountryURLval=' + item.myCountryURL + ' myCountryval=' +
item.myCountry + ' myRegionval=' + item.myRegion + ' myTownval=' +
item.myTown + ' myTermval=' + item.myTerm + ' myAreaval=' +
item.myArea + ' myagentcodeval=' + item.myagentcode + 'img src='
+ item.url + ' width=175 

[jQuery] Superfish opacity / transparancy

2009-04-13 Thread DraaYak

Hi there,

I am trying to make the default superfish menu drop down items to be
non-transparent. At the moment when you hover over a menu item and it
drops down, it is transparent which makes it hard to read the menu
text.

I've tried editing the template.css and superfish.css files
unsuccessfully, and also had a look at the superfish.js file and can't
see where the change needs to be made, or have tried unsuccessfully to
change the settings.

Any help would be much appreciated.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

I am pulling my hair out over this.  I swear that this is a bug.

For some reason, I CANNOT target any forms within the html response.
I have tried very simple examples and it still won't work.  Here is
what I have, that still returns undefined:

HTML:
form id=test action=http://test.com;
span id=test2this is my text/span
/form

jQuery:
success: function(html){
  alert($(html).find(#test).attr('action'));
  alert($(html).find(#test2).text());
}

#test2 works, but #test never does, and it seems this is because it is
a form.  Have I done something wrong here?  Can I not target a form?

On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 I have an ajax GET call that returns the HTML of a page on my server.
 Within that page is a form with a specific ID.  I know it is there, I
 can see it in the response in Firebug, but when I try to get
 attributes of that ID, it always returns undefined!  What have I done
 wrong here?

 success: function(html){

 $(html).find('#main_form').each(function() {
 var linking_data = $(this).serialize();
 var form_action = $(this).attr('action');
 alert(form_action);

 });
 }

 I have tried to not use each() and that still returns undefined.  I
 don't get it.


[jQuery] Re: capture user's selection on a html page

2009-04-13 Thread Andy Matthews

Look into the functionality on the New York Times story pages:
http://www.nytimes.com/2009/04/14/world/asia/14thai.html?_r=1hp

Highlight any block of text inside the story, and you'll get a litle popup
question mark icon which links to a search of that string in the NYT
database.

Pretty handy actually. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of ihomest...@gmail.com
Sent: Monday, April 13, 2009 11:36 AM
To: jQuery (English)
Subject: [jQuery] capture user's selection on a html page


Hi,

There is an onselect event for javascript which allows you to capture user
selected text in text input or textarea box. Is there a way to capture
user's selection anywhere on the html page?

I know several javascript applications which allow users to select elements
on a html page and allow you to copy paste your selected html data into
other places. Would appreciate if anyone points me to some references on how
this is implemented, especially how in Jquery.

Thanks.




[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Test page to show the problem: http://www.puc.edu/dev/tests/ajax-test

On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:
 I am pulling my hair out over this.  I swear that this is a bug.

 For some reason, I CANNOT target any forms within the html response.
 I have tried very simple examples and it still won't work.  Here is
 what I have, that still returns undefined:

 HTML:
 form id=test action=http://test.com;
 span id=test2this is my text/span
 /form

 jQuery:
 success: function(html){
   alert($(html).find(#test).attr('action'));
   alert($(html).find(#test2).text());

 }

 #test2 works, but #test never does, and it seems this is because it is
 a form.  Have I done something wrong here?  Can I not target a form?

 On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  I have an ajax GET call that returns the HTML of a page on my server.
  Within that page is a form with a specific ID.  I know it is there, I
  can see it in the response in Firebug, but when I try to get
  attributes of that ID, it always returns undefined!  What have I done
  wrong here?

  success: function(html){

  $(html).find('#main_form').each(function() {
  var linking_data = $(this).serialize();
  var form_action = $(this).attr('action');
  alert(form_action);

  });
  }

  I have tried to not use each() and that still returns undefined.  I
  don't get it.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan

If I understand correctly what you are tring to do, I think what you
are looking for is the live() event

http://docs.jquery.com/Events/live



On Apr 13, 5:47 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

 On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

  I am pulling my hair out over this.  I swear that this is a bug.

  For some reason, I CANNOT target any forms within the html response.
  I have tried very simple examples and it still won't work.  Here is
  what I have, that still returns undefined:

  HTML:
  form id=test action=http://test.com;
  span id=test2this is my text/span
  /form

  jQuery:
  success: function(html){
    alert($(html).find(#test).attr('action'));
    alert($(html).find(#test2).text());

  }

  #test2 works, but #test never does, and it seems this is because it is
  a form.  Have I done something wrong here?  Can I not target a form?

  On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   I have an ajax GET call that returns the HTML of a page on my server.
   Within that page is a form with a specific ID.  I know it is there, I
   can see it in the response in Firebug, but when I try to get
   attributes of that ID, it always returns undefined!  What have I done
   wrong here?

   success: function(html){

   $(html).find('#main_form').each(function() {
   var linking_data = $(this).serialize();
   var form_action = $(this).attr('action');
   alert(form_action);

   });
   }

   I have tried to not use each() and that still returns undefined.  I
   don't get it.


[jQuery] trouble stopping propagation

2009-04-13 Thread gmoniey


Hi,

I have a simple onclick function call for a div which looks like this:
onclick=showPanel(this).
And the showPanel function header is as such:

function showPanel(el) {
}

I also have some children in the div which are links, and I want top stop
the propagation. Unfortunately, when I put a breakpoint inside showPanel
(using FF3), 'el' does not have any of the following properties: srcElement,
target, stopPropagation. So I can't seem figure out if I should return of
continue the function.

I even tried to wrap the inner links inside a div which had a similar
onclick function whose purpose is only to call stopPropagation, but I got
the same results as above (i.e. no stopPropagation method). 

I thought about establishing the onclick function as such:

$('div').filter('.myPanel').click(function (event) {}); 

and checking the event target inside the function, but I load parts of the
html through ajax, which means I will after run the code above after load,
and that solution just doesnt seem that clean.

Anyone have any ideas on how I can manage this?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/trouble-stopping-propagation-tp23025769s27240p23025769.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Slider for Gallery

2009-04-13 Thread Nathan


There are many great plugins that you can utilize to get this done:

http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider
http://sorgalla.com/jcarousel/
http://code.google.com/p/loopedslider/

Hope that helps ya out.


On Apr 13, 7:51 am, iceangel89 iceange...@gmail.com wrote:
 i am intending to do a slider for my gallery.

 something like i show just 3 images 1st then have a prev  next button
 to slide the gallery left or right to the next 3 (or 1) items. i hope
 u can visualize this, i think a common effect.

 then for a nicer effect. say i allow user to skip to a image. say i
 show items 1-3, i wanna view item 23. so i shld speed and ease in/out
 to that. how can i do this? any plugins or i need to do 1 myself? any
 suggestions or directions?


[jQuery] Re: jQuery multiple toggle - should be quick

2009-04-13 Thread Nathan



You should check out:
http://andylangton.co.uk/articles/javascript/jquery-show-hide-multiple-elements/

That should guide you through what you'll need to do to have multiple
show/hides on a page.


On Apr 13, 6:44 am, Daniel daniel.evil...@gmail.com wrote:
 I have multiple divs called article which have a show/hide link to
 toggle a div inside called articleBody. Problem is when I click the
 link all divs show/hide.

 The html structure is below:

 div class=article
 p class=showa href=#Hide [-]/a/p
 div class=articleBody!-- Stuff i need to hide on click/div
 /div

 Any idea how I can change the toggle the text in show as well as just
 closing that one instance of div article rather than every instance on
 the page?

 Thanks


[jQuery] Re: New jQuery plugin LoopedSlider. Looking for feedback

2009-04-13 Thread Nathan


Yes, check out the examples. No content rewind here!

http://code.google.com/p/loopedslider/

I am looking to make some updates in the coming weeks which will
simplify the code and add a few key features.

Keep an eye out for that.



On Apr 12, 8:38 pm, krisbfunk krisbf...@gmail.com wrote:
 Yes! I've been looking everywhere for this type of content slider. I too am
 wedded to the serialscroll plugin, which allows for animation of images in a
 continuous linear scroll, (with the aid of the easing plugin), but then
 there's the naggy rewind... is it also possible to do this with yours, but
 with a continuous loop of images instead of a rewind?





 Nathan-77 wrote:

  Yeah I know, another content slider, there are way too many. But I've
  wanted something that looped from first to last or last to first slide
  using next/previous buttons and that fades if you click on a slide
  number. So that's why I've created this plugin.

  Would love some code feedback if anyone has a moment to take a look. I
  appreciate any advice or criticism.

  loopedSlider, a jQuery plugin:
  loopedSlider is a plugin made for jQuery that solves a simple problem,
  the looping of slide content. It was created to be easy to implement,
  smooth and most of all end the content rewind that most other
  content sliders suffer from.

 http://code.google.com/p/loopedslider/

 --
 View this message in 
 context:http://www.nabble.com/New-jQuery-plugin-LoopedSlider.-Looking-for-fee...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Works in IE7 but not IE6

2009-04-13 Thread MauiMan2

Have you verified if jQuery is running at all in IE6? For example,
create a new page and insert a simple jQuery action that would let you
know if it's running  (such as an alert message).


That's what I have now: a simple jQuery action and as far as IE6 is
concerned it is not there at all.

Can I save each script file using UTF-8 encoding in Notepad? If not,
how do I do it?

Along with you I too wish I could show the site this is on but at the
moment it's for employees' eyes only.


[jQuery] Getting index of clicked table cell

2009-04-13 Thread MorningZ

For the life of me i cannot figure out why this gives me -1 (not
found)

$(#Table1 tr.SUM).click(function(e) {
  alert($(this).index(e.target));
});

With this being the row, and e.target being the cell, shouldn't
that work?


[jQuery] Error Output with ajaxForm?

2009-04-13 Thread steveoreno

I am having an issue where my success function is not being called,
even when I return true in my beforeSubmit. I don't get Javascript
errors and so I am totally baffled. Any help... hugely appreciated.



//SETUP
  var options = {
success: show_read_response,
beforeSubmit: check_read_form,
error: show_error
  };

  $('#dialog_page_read').ajaxForm(options);

//CHECK
function check_read_form(){
var user_name = $('#read_name').attr(value);
var user_email = $('#read_email').attr(value);

switch(true){
 case user_name.length  5 || user_name.indexOf( ) == -1:
   alert(Please enter your full name);
   return false;
   break;

 case user_email.length  6:
   alert(Your email address is too short);
   return false;
   break;

 case user_email.indexOf( ) != -1:
   alert(Your email address cannot contain spaces);
   return false;
   break;

 case user_email.indexOf(@) == -1:
   alert(Your email address must contain a @ symbol);
   return false;
   break;

 case user_email.indexOf(.) == -1:
   alert(Your email address must contain a period);
   return false;
   break;

 default:
   return true;
}
  }

//SUCCESS
function show_read_response(){
   $(#dialog_page_message h1).text(Check your email inbox!);
   $(#dialog_page_message p).html(A download link is available in
your email inbox.);
   $('#dialog_page_read .clearable').clearFields();
   swap_dialog(message);
  }


[jQuery] Re: Cycle plugin Issue in Safari and Chrome browser

2009-04-13 Thread Mike Alsup

 div class=slideshow
 div class=slideimg src=slide1.jpg alt= title=brdiv
 class=textbackgroundnbsp;/divdiv class=slidetext/div/
 div
 div class=slideimg src=slide2.jpg alt= title=brdiv
 class=textbackgroundnbsp;/divdiv class=slidetext/div/
 div
 /div

 and the css:

 .slideshow{
         width:680px;
         height:250px;

 }

 div.slidetext {
         height:20px;
         width:680px;
         display:block;
         margin-top:-25px;
         margin-left:15px;
         position:absolute;
         }
 div.textbackground {
         display:block;
         height:30px;
         width:680px;
         opacity:0.7;
         margin-top:-30px;
         position:absolute;
         }

 and both the height and the width of .slideshow are not recognized in
 Chrome (but work fine in IE and FF).


How about either giving the slide elements a specific height/width or
adding height/width attributes to the img elements?



[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nathan


You could try changing this: alert($(html).find(#test).attr
('action'));
To This: alert($(#test).attr('action'));


On Apr 13, 9:47 am, Nic Hubbard nnhubb...@gmail.com wrote:
 Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

 On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:



  I am pulling my hair out over this.  I swear that this is a bug.

  For some reason, I CANNOT target any forms within the html response.
  I have tried very simple examples and it still won't work.  Here is
  what I have, that still returns undefined:

  HTML:
  form id=test action=http://test.com;
  span id=test2this is my text/span
  /form

  jQuery:
  success: function(html){
    alert($(html).find(#test).attr('action'));
    alert($(html).find(#test2).text());

  }

  #test2 works, but #test never does, and it seems this is because it is
  a form.  Have I done something wrong here?  Can I not target a form?

  On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   I have an ajax GET call that returns the HTML of a page on my server.
   Within that page is a form with a specific ID.  I know it is there, I
   can see it in the response in Firebug, but when I try to get
   attributes of that ID, it always returns undefined!  What have I done
   wrong here?

   success: function(html){

   $(html).find('#main_form').each(function() {
   var linking_data = $(this).serialize();
   var form_action = $(this).attr('action');
   alert(form_action);

   });
   }

   I have tried to not use each() and that still returns undefined.  I
   don't get it.


[jQuery] Re: generate AJAX data based on number of select elements

2009-04-13 Thread Kinsbane

Having an issue with .serialize() - it's not grabbing the values for
the names of the elements, and it only
does it for those elements that are already on the page when it's
loaded. It's not returning in the serialized string
any of the SELECT elements that get added when someone picks a piece
of literature.

Is it really this hard to get something going? :(

On Apr 10, 10:56 am, Kinsbane kinsb...@gmail.com wrote:
 Hi Ricardo,

 Thanks! Will this serialize everything about the element with class of
 litqty? I will give it a shot.

 I'm sorry for not explaining to others in detail about what I need.
 Here it is:
 Each piece of literature that gets selected returns an ID telling us
 where to pull it from (documents or datasheets)
 and a unique alpha-numeric string called our control number. This is
 what the ID attribute and the NAME attribute in the select element
 holds.
 This is what I need to add to the reqData variable - I need the NAME
 of the ID of the select itself, along with the value of that select,
 because the ID tells us what we need to print
 out and ship.

 Thanks everyone!

 On Apr 10, 9:20 am, Ricardo ricardob...@gmail.com wrote:

  You can't return anything rom $().each, and object literals are not
  scope blocks, that won't work, it would have to be something like
  this:

  $(function() {
          //serialize() creates a query string from the form elements
  provided
          var reqData = $('.litqty').serialize();

          $(form#form_search_country).submit(function() {
                $.post('submitLitRequest.php', reqData);
                return false;
          });

  });

  On Apr 9, 5:02 pm, mattimus5...@gmail.com mattimus5...@gmail.com
  wrote:

   Ok I see your code from the above post now.

   var reqData = {
                   $('select.litqty').each(
                        $(this).attr('name') : $(this).val();
                  );
           }
   This would get the name and value of each select.litqty
   Is this what you are trying to achieve??

   On Apr 9, 3:48 pm, mattimus5...@gmail.com mattimus5...@gmail.com
   wrote:

You are just trying to get the value of the select box and only the
select box???

So you have something like
ul class=books
li Book 1 select class=litqtyoption.. //select/li???
li Book 2 select class=litqtyoption.. //select/li
li Book 3 select class=litqtyoption.. //select/li
li Book 4 select class=litqtyoption.. //select/li
/ul

 What do you need reqData to look like?


[jQuery] ajaxForm: get XmlHttpRequest status?

2009-04-13 Thread Brian J. Cohen

I would like to be able to retrieve the current 'statusText' for the
XmlHttpRequest object used internally by ajaxForm (which I'm fairly
certain actually uses $.ajax()).  What I want is to prevent multiple
simultaneous submissions in certain cases, so a the form submission is
triggered, I want to be able to check if a form submission is
currently in progress, and if so, throw an alert.

Any guidance would be greatly appreciated. Thanks!


[jQuery] Re: capture user's selection on a html page

2009-04-13 Thread ihomest...@gmail.com

Thanks for the link. This is pretty nice. Is there a special
javascript even I could capture to get the user's selection?

On Apr 13, 12:46 pm, Andy Matthews li...@commadelimited.com wrote:
 Look into the functionality on the New York Times story 
 pages:http://www.nytimes.com/2009/04/14/world/asia/14thai.html?_r=1hp

 Highlight any block of text inside the story, and you'll get a litle popup
 question mark icon which links to a search of that string in the NYT
 database.

 Pretty handy actually.

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

 Behalf Of ihomest...@gmail.com
 Sent: Monday, April 13, 2009 11:36 AM
 To: jQuery (English)
 Subject: [jQuery] capture user's selection on a html page

 Hi,

 There is an onselect event for javascript which allows you to capture user
 selected text in text input or textarea box. Is there a way to capture
 user's selection anywhere on the html page?

 I know several javascript applications which allow users to select elements
 on a html page and allow you to copy paste your selected html data into
 other places. Would appreciate if anyone points me to some references on how
 this is implemented, especially how in Jquery.

 Thanks.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Nope, that does not work either.

On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
 Maybe try:

 success: function(html){
   alert($(html).find('form').attr('action'));

 I had some issues in the past using form id's with the jquery form
 plugin, but usually getting it using 'form' worked.

 That said, since the response isn't in the DOM yet, I'm not sure if that
 might present an issue (too/instead).

 - Jack

 Nic Hubbard wrote:
  Yes, this is very odd. I have tried it quite a few ways, but I can
  never target the form.  Any other ideas?

  It is frustrating because I really need to target a form in the html
  response...

  On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

  That's strange. I can't get it to work either and I'm getting the same
  results as you (I can get #test2, but not #test). I've even truncated
  the response down to as if you're only receiving the form part and
  it still doesn't work. I'd be interested in seeing what happens here
  too.

  On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

  Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

  On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

  I am pulling my hair out over this.  I swear that this is a bug.

  For some reason, I CANNOT target any forms within the html response.
  I have tried very simple examples and it still won't work.  Here is
  what I have, that still returns undefined:

  HTML:
  form id=test action=http://test.com;
  span id=test2this is my text/span
  /form

  jQuery:
  success: function(html){
    alert($(html).find(#test).attr('action'));
    alert($(html).find(#test2).text());

  }

  #test2 works, but #test never does, and it seems this is because it is
  a form.  Have I done something wrong here?  Can I not target a form?

  On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  I have an ajax GET call that returns the HTML of a page on my server.
  Within that page is a form with a specific ID.  I know it is there, I
  can see it in the response in Firebug, but when I try to get
  attributes of that ID, it always returns undefined!  What have I done
  wrong here?

  success: function(html){

  $(html).find('#main_form').each(function() {
  var linking_data = $(this).serialize();
  var form_action = $(this).attr('action');
  alert(form_action);

  });
  }

  I have tried to not use each() and that still returns undefined.  I
  don't get it.


[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread Lwangaman

I think I've done it.

http://jsbin.com/adixe/edit

I have also left out the mouseleave event, and applied the mouseup to
the whole document instead of to the table, that way even if I leave
the table but still have the mouse button down, I don't lose the value
in the variable. Only if I let go of the mouse button (on or off the
table) do I reset the variable.

@Ricardo and @jscripter: does this work good?

On 13 Apr, 14:41, Lwangaman donjohn.f...@gmail.com wrote:
 I tried working on it again and made a little progress... Now I got
 parent and child selected correctly, but I don't have mouseover
 working for some reason...

 http://jsbin.com/avigi/edit

 On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:

  One more detail: mouseout should not take effect until mouseup.
  In fact, right now, if I click and begin to drag, then still holding
  the mouse button I leave the area, and still holding it come back over
  the cells, they no longer get checked / unchecked because mouseout has
  already kicked in. Instead it shouldn't kick in until I actually let
  go of the mouse button, and I could let go of it anywhere on the page
  I suppose, so I guess mouseup would have to be applied to the whole
  document.

  On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

   I tried something along those lines...

  http://jsbin.com/ehedu/edit

   But I just don't have the hang of using this correctly and knowing
   when to refer to dom elements as dom elements or as jquery objects...

   The idea is to tie all events to the container of the checkboxes (i.e.
   table cells), and not to the external container (table or ul list or
   whatever), and yet be able to read and write the value of the
   checkboxes...

   On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

Taking up jscripter's suggestion, I just noticed myself that applying
the mousedown and mouseover to the whole table keeps you from being
able to click on any links that may be contained in the table. For
example my table has links in the header cells that when clicked
reorder the table according to that column. Now I can no longer click
them...
And, as jscripter says, in the X-Library the mousedown and mouseover
was applied to the cells containing the checkboxes and not to the
checkboxes themselves, so that it was enough to click on the cells
surrounding the checkboxes in order to get them checked / unchecked.

Ricardo do you think you could manage something like that? (I'm only
an apprentice and I don't have your expertice!)

On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

 Hey - this is great work - I just happened to be looking for this
 functionality.

 How would you apply what you have done here to re-writing the original
 X-library code that uses TDs for the checkbox label?

 Thanks!

 On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

  Sure! I have a few other plugins I also want to upload, I'll do 
  that.

  I took the time to rewrite it more carefully. No more binding/
  unbinding, a single var, all namespaced and bugs ironed out (if you
  put the cursor away while holding the button, the mouseover would
  remain active even after mouseup).

  The advantage of namespacing is you can easily remove all event
  handlers. I included that in the plugin, in the example you can use 
  $
  ('ul').dragCheck(false) to disable it completely.

 http://jsbin.com/amoxi/edit

  cheers,
  - ricardo

  On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

   @Ricardo
   Do you think it could be useful to add this to the jquery plugins 
   at
   plugins.jquery.com? I'd say it could be put under your name 
   because
   you did all the big work!

   On 12 Apr, 14:35, Lwangaman donjohn.f...@gmail.com wrote:

Ok that works better, I just changed clicked.checked = 
!isChecked to
clicked.checked = isChecked:

   http://jsbin.com/idihi/edit

On 12 Apr, 08:11, Ricardo ricardob...@gmail.com wrote:

 The problem with your fix is that the event target for the 
 mouseup is
 not the same as the mousedown. You can resolve that by saving 
 the
 clicked checkbox in a var, and because of event order the 
 change has
 to be made on 'click' rather than mouseup.

http://jsbin.com/asizu/edit

 Sorry for the bugs, this was written rather quickly, I hope 
 it works
 now :)

 On Apr 11, 11:30 am, Lwangaman donjohn.f...@gmail.com wrote:

  Ok I tried to touch up the code a little to fix that, 
  here's my
  example:

 http://jsbin.com/iyubi/edit

  Now, with a single click, the value on mouseup is reversed 
  to keep it
  as it was with mousedown. But, when you do a drag, the 
  mouseup of the
 

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Nope, that returns undefined as well. :(

On Apr 13, 11:34 am, Nathan nsear...@gmail.com wrote:
 You could try changing this: alert($(html).find(#test).attr
 ('action'));
 To This: alert($(#test).attr('action'));

 On Apr 13, 9:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

  Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

  On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

   I am pulling my hair out over this.  I swear that this is a bug.

   For some reason, I CANNOT target any forms within the html response.
   I have tried very simple examples and it still won't work.  Here is
   what I have, that still returns undefined:

   HTML:
   form id=test action=http://test.com;
   span id=test2this is my text/span
   /form

   jQuery:
   success: function(html){
     alert($(html).find(#test).attr('action'));
     alert($(html).find(#test2).text());

   }

   #test2 works, but #test never does, and it seems this is because it is
   a form.  Have I done something wrong here?  Can I not target a form?

   On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

I have an ajax GET call that returns the HTML of a page on my server.
Within that page is a form with a specific ID.  I know it is there, I
can see it in the response in Firebug, but when I try to get
attributes of that ID, it always returns undefined!  What have I done
wrong here?

success: function(html){

$(html).find('#main_form').each(function() {
var linking_data = $(this).serialize();
var form_action = $(this).attr('action');
alert(form_action);

});
}

I have tried to not use each() and that still returns undefined.  I
don't get it.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Jack Killpatrick

Maybe try:

success: function(html){
 alert($(html).find('form').attr('action'));

I had some issues in the past using form id's with the jquery form 
plugin, but usually getting it using 'form' worked.


That said, since the response isn't in the DOM yet, I'm not sure if that 
might present an issue (too/instead).


- Jack

Nic Hubbard wrote:

Yes, this is very odd. I have tried it quite a few ways, but I can
never target the form.  Any other ideas?

It is frustrating because I really need to target a form in the html
response...

On Apr 13, 11:45 am, James james.gp@gmail.com wrote:
  

That's strange. I can't get it to work either and I'm getting the same
results as you (I can get #test2, but not #test). I've even truncated
the response down to as if you're only receiving the form part and
it still doesn't work. I'd be interested in seeing what happens here
too.

On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:



Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test
  
On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:
  

I am pulling my hair out over this.  I swear that this is a bug.

For some reason, I CANNOT target any forms within the html response.

I have tried very simple examples and it still won't work.  Here is
what I have, that still returns undefined:

HTML:

form id=test action=http://test.com;
span id=test2this is my text/span
/form

jQuery:

success: function(html){
  alert($(html).find(#test).attr('action'));
  alert($(html).find(#test2).text());

}

#test2 works, but #test never does, and it seems this is because it is

a form.  Have I done something wrong here?  Can I not target a form?

On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:


I have an ajax GET call that returns the HTML of a page on my server.
Within that page is a form with a specific ID.  I know it is there, I
can see it in the response in Firebug, but when I try to get
attributes of that ID, it always returns undefined!  What have I done
wrong here?
  
success: function(html){
  
$(html).find('#main_form').each(function() {

var linking_data = $(this).serialize();
var form_action = $(this).attr('action');
alert(form_action);
  
});

}
  
I have tried to not use each() and that still returns undefined.  I

don't get it.
  


  




[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Yes, this is very odd. I have tried it quite a few ways, but I can
never target the form.  Any other ideas?

It is frustrating because I really need to target a form in the html
response...

On Apr 13, 11:45 am, James james.gp@gmail.com wrote:
 That's strange. I can't get it to work either and I'm getting the same
 results as you (I can get #test2, but not #test). I've even truncated
 the response down to as if you're only receiving the form part and
 it still doesn't work. I'd be interested in seeing what happens here
 too.

 On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

  Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

  On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

   I am pulling my hair out over this.  I swear that this is a bug.

   For some reason, I CANNOT target any forms within the html response.
   I have tried very simple examples and it still won't work.  Here is
   what I have, that still returns undefined:

   HTML:
   form id=test action=http://test.com;
   span id=test2this is my text/span
   /form

   jQuery:
   success: function(html){
     alert($(html).find(#test).attr('action'));
     alert($(html).find(#test2).text());

   }

   #test2 works, but #test never does, and it seems this is because it is
   a form.  Have I done something wrong here?  Can I not target a form?

   On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

I have an ajax GET call that returns the HTML of a page on my server.
Within that page is a form with a specific ID.  I know it is there, I
can see it in the response in Firebug, but when I try to get
attributes of that ID, it always returns undefined!  What have I done
wrong here?

success: function(html){

$(html).find('#main_form').each(function() {
var linking_data = $(this).serialize();
var form_action = $(this).attr('action');
alert(form_action);

});
}

I have tried to not use each() and that still returns undefined.  I
don't get it.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread James

That's strange. I can't get it to work either and I'm getting the same
results as you (I can get #test2, but not #test). I've even truncated
the response down to as if you're only receiving the form part and
it still doesn't work. I'd be interested in seeing what happens here
too.


On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:
 Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

 On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

  I am pulling my hair out over this.  I swear that this is a bug.

  For some reason, I CANNOT target any forms within the html response.
  I have tried very simple examples and it still won't work.  Here is
  what I have, that still returns undefined:

  HTML:
  form id=test action=http://test.com;
  span id=test2this is my text/span
  /form

  jQuery:
  success: function(html){
    alert($(html).find(#test).attr('action'));
    alert($(html).find(#test2).text());

  }

  #test2 works, but #test never does, and it seems this is because it is
  a form.  Have I done something wrong here?  Can I not target a form?

  On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   I have an ajax GET call that returns the HTML of a page on my server.
   Within that page is a form with a specific ID.  I know it is there, I
   can see it in the response in Firebug, but when I try to get
   attributes of that ID, it always returns undefined!  What have I done
   wrong here?

   success: function(html){

   $(html).find('#main_form').each(function() {
   var linking_data = $(this).serialize();
   var form_action = $(this).attr('action');
   alert(form_action);

   });
   }

   I have tried to not use each() and that still returns undefined.  I
   don't get it.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Luciano
Hey Nic,

I have a couple small recommendations- hopefully one will fix the issue.

Try using $.get() instead of $.ajax, and specify type option as html-
alternatively, you can use $.load() if your ultimate purpose is to inject
this HTML into DOM.

In addition rather than using find(), just select by ID as a subset of the
DOM node..

alert($(html).find(#test) becomes
alert($(#test, html));

Hope some of this helps... cheers!

Nic Luciano
Senior Web Developer @ AdaptiveBlue
http://www.twitter.com/nicluciano
http://www.linkedin.com/in/nicluciano


On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com wrote:


 Nope, that does not work either.

 On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
  Maybe try:
 
  success: function(html){
alert($(html).find('form').attr('action'));
 
  I had some issues in the past using form id's with the jquery form
  plugin, but usually getting it using 'form' worked.
 
  That said, since the response isn't in the DOM yet, I'm not sure if that
  might present an issue (too/instead).
 
  - Jack
 
  Nic Hubbard wrote:
   Yes, this is very odd. I have tried it quite a few ways, but I can
   never target the form.  Any other ideas?
 
   It is frustrating because I really need to target a form in the html
   response...
 
   On Apr 13, 11:45 am, James james.gp@gmail.com wrote:
 
   That's strange. I can't get it to work either and I'm getting the same
   results as you (I can get #test2, but not #test). I've even truncated
   the response down to as if you're only receiving the form part and
   it still doesn't work. I'd be interested in seeing what happens here
   too.
 
   On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:
 
   Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test
 
   On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:
 
   I am pulling my hair out over this.  I swear that this is a bug.
 
   For some reason, I CANNOT target any forms within the html response.
   I have tried very simple examples and it still won't work.  Here is
   what I have, that still returns undefined:
 
   HTML:
   form id=test action=http://test.com;
   span id=test2this is my text/span
   /form
 
   jQuery:
   success: function(html){
 alert($(html).find(#test).attr('action'));
 alert($(html).find(#test2).text());
 
   }
 
   #test2 works, but #test never does, and it seems this is because it
 is
   a form.  Have I done something wrong here?  Can I not target a form?
 
   On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 
   I have an ajax GET call that returns the HTML of a page on my
 server.
   Within that page is a form with a specific ID.  I know it is there,
 I
   can see it in the response in Firebug, but when I try to get
   attributes of that ID, it always returns undefined!  What have I
 done
   wrong here?
 
   success: function(html){
 
   $(html).find('#main_form').each(function() {
   var linking_data = $(this).serialize();
   var form_action = $(this).attr('action');
   alert(form_action);
 
   });
   }
 
   I have tried to not use each() and that still returns undefined.  I
   don't get it.



[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Ok, my test now reflects your suggestions.  But, sadly, none of that
helped, it is still returning undefined. :(

On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:
 Hey Nic,

 I have a couple small recommendations- hopefully one will fix the issue.

 Try using $.get() instead of $.ajax, and specify type option as html-
 alternatively, you can use $.load() if your ultimate purpose is to inject
 this HTML into DOM.

 In addition rather than using find(), just select by ID as a subset of the
 DOM node..

 alert($(html).find(#test) becomes
 alert($(#test, html));

 Hope some of this helps... cheers!

 Nic Luciano
 Senior Web Developer @ 
 AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

 On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com wrote:

  Nope, that does not work either.

  On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
   Maybe try:

   success: function(html){
     alert($(html).find('form').attr('action'));

   I had some issues in the past using form id's with the jquery form
   plugin, but usually getting it using 'form' worked.

   That said, since the response isn't in the DOM yet, I'm not sure if that
   might present an issue (too/instead).

   - Jack

   Nic Hubbard wrote:
Yes, this is very odd. I have tried it quite a few ways, but I can
never target the form.  Any other ideas?

It is frustrating because I really need to target a form in the html
response...

On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

That's strange. I can't get it to work either and I'm getting the same
results as you (I can get #test2, but not #test). I've even truncated
the response down to as if you're only receiving the form part and
it still doesn't work. I'd be interested in seeing what happens here
too.

On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

I am pulling my hair out over this.  I swear that this is a bug.

For some reason, I CANNOT target any forms within the html response.
I have tried very simple examples and it still won't work.  Here is
what I have, that still returns undefined:

HTML:
form id=test action=http://test.com;
span id=test2this is my text/span
/form

jQuery:
success: function(html){
  alert($(html).find(#test).attr('action'));
  alert($(html).find(#test2).text());

}

#test2 works, but #test never does, and it seems this is because it
  is
a form.  Have I done something wrong here?  Can I not target a form?

On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

I have an ajax GET call that returns the HTML of a page on my
  server.
Within that page is a form with a specific ID.  I know it is there,
  I
can see it in the response in Firebug, but when I try to get
attributes of that ID, it always returns undefined!  What have I
  done
wrong here?

success: function(html){

$(html).find('#main_form').each(function() {
var linking_data = $(this).serialize();
var form_action = $(this).attr('action');
alert(form_action);

});
}

I have tried to not use each() and that still returns undefined.  I
don't get it.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread finco

Just a guess here - is it possible that jquery will not recognize
nodes that are loaded after the document is first rendered?  Do you
need to rebind?

On Apr 13, 4:28 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 Ok, my test now reflects your suggestions.  But, sadly, none of that
 helped, it is still returning undefined. :(

 On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:



  Hey Nic,

  I have a couple small recommendations- hopefully one will fix the issue.

  Try using $.get() instead of $.ajax, and specify type option as html-
  alternatively, you can use $.load() if your ultimate purpose is to inject
  this HTML into DOM.

  In addition rather than using find(), just select by ID as a subset of the
  DOM node..

  alert($(html).find(#test) becomes
  alert($(#test, html));

  Hope some of this helps... cheers!

  Nic Luciano
  Senior Web Developer @ 
  AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

  On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com wrote:

   Nope, that does not work either.

   On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
Maybe try:

success: function(html){
  alert($(html).find('form').attr('action'));

I had some issues in the past using form id's with the jquery form
plugin, but usually getting it using 'form' worked.

That said, since the response isn't in the DOM yet, I'm not sure if that
might present an issue (too/instead).

- Jack

Nic Hubbard wrote:
 Yes, this is very odd. I have tried it quite a few ways, but I can
 never target the form.  Any other ideas?

 It is frustrating because I really need to target a form in the html
 response...

 On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

 That's strange. I can't get it to work either and I'm getting the 
 same
 results as you (I can get #test2, but not #test). I've even truncated
 the response down to as if you're only receiving the form part and
 it still doesn't work. I'd be interested in seeing what happens here
 too.

 On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

 Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

 On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

 I am pulling my hair out over this.  I swear that this is a bug.

 For some reason, I CANNOT target any forms within the html 
 response.
 I have tried very simple examples and it still won't work.  Here is
 what I have, that still returns undefined:

 HTML:
 form id=test action=http://test.com;
 span id=test2this is my text/span
 /form

 jQuery:
 success: function(html){
   alert($(html).find(#test).attr('action'));
   alert($(html).find(#test2).text());

 }

 #test2 works, but #test never does, and it seems this is because it
   is
 a form.  Have I done something wrong here?  Can I not target a 
 form?

 On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

 I have an ajax GET call that returns the HTML of a page on my
   server.
 Within that page is a form with a specific ID.  I know it is 
 there,
   I
 can see it in the response in Firebug, but when I try to get
 attributes of that ID, it always returns undefined!  What have I
   done
 wrong here?

 success: function(html){

 $(html).find('#main_form').each(function() {
 var linking_data = $(this).serialize();
 var form_action = $(this).attr('action');
 alert(form_action);

 });
 }

 I have tried to not use each() and that still returns undefined.  
 I
 don't get it.


[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread jscripter

Looks good under Firefox and Opera except that when I click-n-drag I
am also selecting text. I'm still not sure how the original code
avoided that.

Under Chrome is't not working at all. :-(

On Apr 13, 2:30 pm, Lwangaman donjohn.f...@gmail.com wrote:
 I think I've done it.

 http://jsbin.com/adixe/edit

 I have also left out the mouseleave event, and applied the mouseup to
 the whole document instead of to the table, that way even if I leave
 the table but still have the mouse button down, I don't lose the value
 in the variable. Only if I let go of the mouse button (on or off the
 table) do I reset the variable.

 @Ricardo and @jscripter: does this work good?

 On 13 Apr, 14:41, Lwangaman donjohn.f...@gmail.com wrote:



  I tried working on it again and made a little progress... Now I got
  parent and child selected correctly, but I don't have mouseover
  working for some reason...

 http://jsbin.com/avigi/edit

  On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:

   One more detail: mouseout should not take effect until mouseup.
   In fact, right now, if I click and begin to drag, then still holding
   the mouse button I leave the area, and still holding it come back over
   the cells, they no longer get checked / unchecked because mouseout has
   already kicked in. Instead it shouldn't kick in until I actually let
   go of the mouse button, and I could let go of it anywhere on the page
   I suppose, so I guess mouseup would have to be applied to the whole
   document.

   On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

I tried something along those lines...

   http://jsbin.com/ehedu/edit

But I just don't have the hang of using this correctly and knowing
when to refer to dom elements as dom elements or as jquery objects...

The idea is to tie all events to the container of the checkboxes (i.e.
table cells), and not to the external container (table or ul list or
whatever), and yet be able to read and write the value of the
checkboxes...

On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

 Taking up jscripter's suggestion, I just noticed myself that applying
 the mousedown and mouseover to the whole table keeps you from being
 able to click on any links that may be contained in the table. For
 example my table has links in the header cells that when clicked
 reorder the table according to that column. Now I can no longer click
 them...
 And, as jscripter says, in the X-Library the mousedown and mouseover
 was applied to the cells containing the checkboxes and not to the
 checkboxes themselves, so that it was enough to click on the cells
 surrounding the checkboxes in order to get them checked / unchecked.

 Ricardo do you think you could manage something like that? (I'm only
 an apprentice and I don't have your expertice!)

 On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

  Hey - this is great work - I just happened to be looking for this
  functionality.

  How would you apply what you have done here to re-writing the 
  original
  X-library code that uses TDs for the checkbox label?

  Thanks!

  On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

   Sure! I have a few other plugins I also want to upload, I'll do 
   that.

   I took the time to rewrite it more carefully. No more binding/
   unbinding, a single var, all namespaced and bugs ironed out (if 
   you
   put the cursor away while holding the button, the mouseover would
   remain active even after mouseup).

   The advantage of namespacing is you can easily remove all event
   handlers. I included that in the plugin, in the example you can 
   use $
   ('ul').dragCheck(false) to disable it completely.

  http://jsbin.com/amoxi/edit

   cheers,
   - ricardo

   On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

@Ricardo
Do you think it could be useful to add this to the jquery 
plugins at
plugins.jquery.com? I'd say it could be put under your name 
because
you did all the big work!

On 12 Apr, 14:35, Lwangaman donjohn.f...@gmail.com wrote:

 Ok that works better, I just changed clicked.checked = 
 !isChecked to
 clicked.checked = isChecked:

http://jsbin.com/idihi/edit

 On 12 Apr, 08:11, Ricardo ricardob...@gmail.com wrote:

  The problem with your fix is that the event target for the 
  mouseup is
  not the same as the mousedown. You can resolve that by 
  saving the
  clicked checkbox in a var, and because of event order the 
  change has
  to be made on 'click' rather than mouseup.

 http://jsbin.com/asizu/edit

  Sorry for the bugs, this was written rather quickly, I hope 
  it works
  now :)

  On Apr 11, 11:30 am, Lwangaman 

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread James

I still haven't figured it out, but playing around and setting the
ajax response as a jquery object, $(html), and making it global so I
can view it's attributes through Firebug, I was able to locate the
form element on the ajax response. It was the index-5 element for your
test page. My sample code below. Though this still doesn't help as to
why we can't reference it using #test2, maybe someone else can get
something more out of it.

I've also tried appended the response to the page and still no go.

--

var globalHTML;  // global variable

$(document).ready(function() {

$.ajax({
url: 'http://www.puc.edu/dev/tests/linking-test',
type: 'GET',
success: function(html) {
var $html = $(html);  // wrap response as jquery object

globalHTML = $html;  // check object with firebug

alert( $html.get(5).action );
}
});

});

Using Firebug and looking at the attributes of the object I've found
that the form is on the 5th-index of the object, for your test page.
Though this still doesn't really help much

alert( $(html).get(5).action );

On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:
 Ok, my test now reflects your suggestions.  But, sadly, none of that
 helped, it is still returning undefined. :(

 On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

  Hey Nic,

  I have a couple small recommendations- hopefully one will fix the issue.

  Try using $.get() instead of $.ajax, and specify type option as html-
  alternatively, you can use $.load() if your ultimate purpose is to inject
  this HTML into DOM.

  In addition rather than using find(), just select by ID as a subset of the
  DOM node..

  alert($(html).find(#test) becomes
  alert($(#test, html));

  Hope some of this helps... cheers!

  Nic Luciano
  Senior Web Developer @ 
  AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

  On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com wrote:

   Nope, that does not work either.

   On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
Maybe try:

success: function(html){
  alert($(html).find('form').attr('action'));

I had some issues in the past using form id's with the jquery form
plugin, but usually getting it using 'form' worked.

That said, since the response isn't in the DOM yet, I'm not sure if that
might present an issue (too/instead).

- Jack

Nic Hubbard wrote:
 Yes, this is very odd. I have tried it quite a few ways, but I can
 never target the form.  Any other ideas?

 It is frustrating because I really need to target a form in the html
 response...

 On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

 That's strange. I can't get it to work either and I'm getting the 
 same
 results as you (I can get #test2, but not #test). I've even truncated
 the response down to as if you're only receiving the form part and
 it still doesn't work. I'd be interested in seeing what happens here
 too.

 On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

 Test page to show the problem:http://www.puc.edu/dev/tests/ajax-test

 On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

 I am pulling my hair out over this.  I swear that this is a bug.

 For some reason, I CANNOT target any forms within the html 
 response.
 I have tried very simple examples and it still won't work.  Here is
 what I have, that still returns undefined:

 HTML:
 form id=test action=http://test.com;
 span id=test2this is my text/span
 /form

 jQuery:
 success: function(html){
   alert($(html).find(#test).attr('action'));
   alert($(html).find(#test2).text());

 }

 #test2 works, but #test never does, and it seems this is because it
   is
 a form.  Have I done something wrong here?  Can I not target a 
 form?

 On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

 I have an ajax GET call that returns the HTML of a page on my
   server.
 Within that page is a form with a specific ID.  I know it is 
 there,
   I
 can see it in the response in Firebug, but when I try to get
 attributes of that ID, it always returns undefined!  What have I
   done
 wrong here?

 success: function(html){

 $(html).find('#main_form').each(function() {
 var linking_data = $(this).serialize();
 var form_action = $(this).attr('action');
 alert(form_action);

 });
 }

 I have tried to not use each() and that still returns undefined.  
 I
 don't get it.


[jQuery] Trouble passing additional data with getJSON

2009-04-13 Thread Kathryn

Hi all,

I think I must be making an obvious mistake, but I can't see it. I'm
trying to pass additional data to the server with getJSON, but it's
not working.

Here's my function:

$(document).ready(function() {
$('#submit_uid').click(function() {
  $.getJSON('pwreset_proc.asp',{check_type: 'verify_uid', uid: $
('#uid').val(), ajax: 'true'}, function(json){
  alert(json);
   });
 });
});

Here's the form, with the button referenced in the click function:

form method=post name=enter_uid
ID: input name=uid id=uid type=text
input name=submit_uid id=submit_uid type=button value=Submit
/form

Here's the code in pwreset_proc.asp:

dim check_type, uid
check_type = request.QueryString(check_type)
uid = request.QueryString(uid)
(this is followed by an SQL query that uses the passed data)

When I click Submit, the form just fails quietly.

To see if the problem was in the asp page, I hard coded the variables,
and the page works fine. So then I tried the asp code above followed
by
response.write(check_type)
response.end()

and the page came up blank. So it appears that the data is not being
passed from the form to the asp page.

The thing is, I have used a similar function on another page and it
works fine. The only difference is that it's attached to the change
event of a dropdown rather than the click event of a button. What am I
missing???

Thanks!

Kathryn


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Could this be a jQuery bug?

On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:
 I still haven't figured it out, but playing around and setting the
 ajax response as a jquery object, $(html), and making it global so I
 can view it's attributes through Firebug, I was able to locate the
 form element on the ajax response. It was the index-5 element for your
 test page. My sample code below. Though this still doesn't help as to
 why we can't reference it using #test2, maybe someone else can get
 something more out of it.

 I've also tried appended the response to the page and still no go.

 --

 var globalHTML;  // global variable

 $(document).ready(function() {

         $.ajax({
                 url: 'http://www.puc.edu/dev/tests/linking-test',
                 type: 'GET',
                 success: function(html) {
                         var $html = $(html);  // wrap response as jquery 
 object

                         globalHTML = $html;  // check object with firebug

                         alert( $html.get(5).action );
                 }
         });

 });

 Using Firebug and looking at the attributes of the object I've found
 that the form is on the 5th-index of the object, for your test page.
 Though this still doesn't really help much

 alert( $(html).get(5).action );

 On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

  Ok, my test now reflects your suggestions.  But, sadly, none of that
  helped, it is still returning undefined. :(

  On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

   Hey Nic,

   I have a couple small recommendations- hopefully one will fix the issue.

   Try using $.get() instead of $.ajax, and specify type option as html-
   alternatively, you can use $.load() if your ultimate purpose is to inject
   this HTML into DOM.

   In addition rather than using find(), just select by ID as a subset of the
   DOM node..

   alert($(html).find(#test) becomes
   alert($(#test, html));

   Hope some of this helps... cheers!

   Nic Luciano
   Senior Web Developer @ 
   AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

   On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com wrote:

Nope, that does not work either.

On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
 Maybe try:

 success: function(html){
   alert($(html).find('form').attr('action'));

 I had some issues in the past using form id's with the jquery form
 plugin, but usually getting it using 'form' worked.

 That said, since the response isn't in the DOM yet, I'm not sure if 
 that
 might present an issue (too/instead).

 - Jack

 Nic Hubbard wrote:
  Yes, this is very odd. I have tried it quite a few ways, but I can
  never target the form.  Any other ideas?

  It is frustrating because I really need to target a form in the html
  response...

  On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

  That's strange. I can't get it to work either and I'm getting the 
  same
  results as you (I can get #test2, but not #test). I've even 
  truncated
  the response down to as if you're only receiving the form part 
  and
  it still doesn't work. I'd be interested in seeing what happens 
  here
  too.

  On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

  Test page to show the 
  problem:http://www.puc.edu/dev/tests/ajax-test

  On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

  I am pulling my hair out over this.  I swear that this is a bug.

  For some reason, I CANNOT target any forms within the html 
  response.
  I have tried very simple examples and it still won't work.  Here 
  is
  what I have, that still returns undefined:

  HTML:
  form id=test action=http://test.com;
  span id=test2this is my text/span
  /form

  jQuery:
  success: function(html){
    alert($(html).find(#test).attr('action'));
    alert($(html).find(#test2).text());

  }

  #test2 works, but #test never does, and it seems this is because 
  it
is
  a form.  Have I done something wrong here?  Can I not target a 
  form?

  On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  I have an ajax GET call that returns the HTML of a page on my
server.
  Within that page is a form with a specific ID.  I know it is 
  there,
I
  can see it in the response in Firebug, but when I try to get
  attributes of that ID, it always returns undefined!  What have I
done
  wrong here?

  success: function(html){

  $(html).find('#main_form').each(function() {
  var linking_data = $(this).serialize();
  var form_action = $(this).attr('action');
  alert(form_action);

  });
  }

  I have tried to not use each() and that still returns 
  

[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread jscripter

Here's what I'm shooting for:

http://jsbin.com/izoce/edit

It's basically the same code as found on cross-browser.com, but I've
added the cell highlighting.

Works under Firefox, Opera and Chrome. It should also work under IE,
but it doesn't seem to work when on the jsbin.com site. However, if
you just download it and run it from a local file it should work for
you.

The text selection bug is basically fixed. It is still possible to
select text if the mousedown event occurs in the right place between
cells. I don't think text selection is possible if the border width is
set to 0 (but then you also don't get a border.)


On Apr 13, 2:30 pm, Lwangaman donjohn.f...@gmail.com wrote:
 I think I've done it.

 http://jsbin.com/adixe/edit

 I have also left out the mouseleave event, and applied the mouseup to
 the whole document instead of to the table, that way even if I leave
 the table but still have the mouse button down, I don't lose the value
 in the variable. Only if I let go of the mouse button (on or off the
 table) do I reset the variable.

 @Ricardo and @jscripter: does this work good?

 On 13 Apr, 14:41, Lwangaman donjohn.f...@gmail.com wrote:



  I tried working on it again and made a little progress... Now I got
  parent and child selected correctly, but I don't have mouseover
  working for some reason...

 http://jsbin.com/avigi/edit

  On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:

   One more detail: mouseout should not take effect until mouseup.
   In fact, right now, if I click and begin to drag, then still holding
   the mouse button I leave the area, and still holding it come back over
   the cells, they no longer get checked / unchecked because mouseout has
   already kicked in. Instead it shouldn't kick in until I actually let
   go of the mouse button, and I could let go of it anywhere on the page
   I suppose, so I guess mouseup would have to be applied to the whole
   document.

   On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

I tried something along those lines...

   http://jsbin.com/ehedu/edit

But I just don't have the hang of using this correctly and knowing
when to refer to dom elements as dom elements or as jquery objects...

The idea is to tie all events to the container of the checkboxes (i.e.
table cells), and not to the external container (table or ul list or
whatever), and yet be able to read and write the value of the
checkboxes...

On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

 Taking up jscripter's suggestion, I just noticed myself that applying
 the mousedown and mouseover to the whole table keeps you from being
 able to click on any links that may be contained in the table. For
 example my table has links in the header cells that when clicked
 reorder the table according to that column. Now I can no longer click
 them...
 And, as jscripter says, in the X-Library the mousedown and mouseover
 was applied to the cells containing the checkboxes and not to the
 checkboxes themselves, so that it was enough to click on the cells
 surrounding the checkboxes in order to get them checked / unchecked.

 Ricardo do you think you could manage something like that? (I'm only
 an apprentice and I don't have your expertice!)

 On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

  Hey - this is great work - I just happened to be looking for this
  functionality.

  How would you apply what you have done here to re-writing the 
  original
  X-library code that uses TDs for the checkbox label?

  Thanks!

  On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

   Sure! I have a few other plugins I also want to upload, I'll do 
   that.

   I took the time to rewrite it more carefully. No more binding/
   unbinding, a single var, all namespaced and bugs ironed out (if 
   you
   put the cursor away while holding the button, the mouseover would
   remain active even after mouseup).

   The advantage of namespacing is you can easily remove all event
   handlers. I included that in the plugin, in the example you can 
   use $
   ('ul').dragCheck(false) to disable it completely.

  http://jsbin.com/amoxi/edit

   cheers,
   - ricardo

   On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

@Ricardo
Do you think it could be useful to add this to the jquery 
plugins at
plugins.jquery.com? I'd say it could be put under your name 
because
you did all the big work!

On 12 Apr, 14:35, Lwangaman donjohn.f...@gmail.com wrote:

 Ok that works better, I just changed clicked.checked = 
 !isChecked to
 clicked.checked = isChecked:

http://jsbin.com/idihi/edit

 On 12 Apr, 08:11, Ricardo ricardob...@gmail.com wrote:

  The problem with your fix is that the event target for the 
 

[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread jscripter

Sorry - one more item

Under Chrome there is a bug if you mousedown on one of the checkboxes
and then immediately mouse up. The cell hightlighing is out of sync
with the checkbox state. How that can happen is complete mystery to me
since updateBackground() always checks the .checked attribute of the
checkbox.

On Apr 13, 2:30 pm, Lwangaman donjohn.f...@gmail.com wrote:
 I think I've done it.

 http://jsbin.com/adixe/edit

 I have also left out the mouseleave event, and applied the mouseup to
 the whole document instead of to the table, that way even if I leave
 the table but still have the mouse button down, I don't lose the value
 in the variable. Only if I let go of the mouse button (on or off the
 table) do I reset the variable.

 @Ricardo and @jscripter: does this work good?

 On 13 Apr, 14:41, Lwangaman donjohn.f...@gmail.com wrote:



  I tried working on it again and made a little progress... Now I got
  parent and child selected correctly, but I don't have mouseover
  working for some reason...

 http://jsbin.com/avigi/edit

  On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:

   One more detail: mouseout should not take effect until mouseup.
   In fact, right now, if I click and begin to drag, then still holding
   the mouse button I leave the area, and still holding it come back over
   the cells, they no longer get checked / unchecked because mouseout has
   already kicked in. Instead it shouldn't kick in until I actually let
   go of the mouse button, and I could let go of it anywhere on the page
   I suppose, so I guess mouseup would have to be applied to the whole
   document.

   On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

I tried something along those lines...

   http://jsbin.com/ehedu/edit

But I just don't have the hang of using this correctly and knowing
when to refer to dom elements as dom elements or as jquery objects...

The idea is to tie all events to the container of the checkboxes (i.e.
table cells), and not to the external container (table or ul list or
whatever), and yet be able to read and write the value of the
checkboxes...

On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

 Taking up jscripter's suggestion, I just noticed myself that applying
 the mousedown and mouseover to the whole table keeps you from being
 able to click on any links that may be contained in the table. For
 example my table has links in the header cells that when clicked
 reorder the table according to that column. Now I can no longer click
 them...
 And, as jscripter says, in the X-Library the mousedown and mouseover
 was applied to the cells containing the checkboxes and not to the
 checkboxes themselves, so that it was enough to click on the cells
 surrounding the checkboxes in order to get them checked / unchecked.

 Ricardo do you think you could manage something like that? (I'm only
 an apprentice and I don't have your expertice!)

 On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

  Hey - this is great work - I just happened to be looking for this
  functionality.

  How would you apply what you have done here to re-writing the 
  original
  X-library code that uses TDs for the checkbox label?

  Thanks!

  On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

   Sure! I have a few other plugins I also want to upload, I'll do 
   that.

   I took the time to rewrite it more carefully. No more binding/
   unbinding, a single var, all namespaced and bugs ironed out (if 
   you
   put the cursor away while holding the button, the mouseover would
   remain active even after mouseup).

   The advantage of namespacing is you can easily remove all event
   handlers. I included that in the plugin, in the example you can 
   use $
   ('ul').dragCheck(false) to disable it completely.

  http://jsbin.com/amoxi/edit

   cheers,
   - ricardo

   On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

@Ricardo
Do you think it could be useful to add this to the jquery 
plugins at
plugins.jquery.com? I'd say it could be put under your name 
because
you did all the big work!

On 12 Apr, 14:35, Lwangaman donjohn.f...@gmail.com wrote:

 Ok that works better, I just changed clicked.checked = 
 !isChecked to
 clicked.checked = isChecked:

http://jsbin.com/idihi/edit

 On 12 Apr, 08:11, Ricardo ricardob...@gmail.com wrote:

  The problem with your fix is that the event target for the 
  mouseup is
  not the same as the mousedown. You can resolve that by 
  saving the
  clicked checkbox in a var, and because of event order the 
  change has
  to be made on 'click' rather than mouseup.

 http://jsbin.com/asizu/edit

  Sorry for the 

[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread Lwangaman

That was avoided by canceling the selectstart event, and in fact
it's working fine in Internet Explorer and in Chrome. I just tried
Firefox and you're right, it's not working right in Firefox. I'm not
sure why you say that it doesn't work under Chrome, I wrote the code
using Chrome and it worked fine for me. Try emptying the cache or
something...
I also fixed the clear function, now you do $('table').dragCheck
('clear') and it seems to be working.

Latest code: http://jsbin.com/adume/

I see another problem: since mouseup is canceled on the whole page,
any checkbox that is out of the range indicated (for example nono in
the example) get's reversed on a simple click...

On 13 Apr, 23:12, jscripter pc88m...@gmail.com wrote:
 Looks good under Firefox and Opera except that when I click-n-drag I
 am also selecting text. I'm still not sure how the original code
 avoided that.

 Under Chrome is't not working at all. :-(

 On Apr 13, 2:30 pm, Lwangaman donjohn.f...@gmail.com wrote:

  I think I've done it.

 http://jsbin.com/adixe/edit

  I have also left out the mouseleave event, and applied the mouseup to
  the whole document instead of to the table, that way even if I leave
  the table but still have the mouse button down, I don't lose the value
  in the variable. Only if I let go of the mouse button (on or off the
  table) do I reset the variable.

  @Ricardo and @jscripter: does this work good?

  On 13 Apr, 14:41, Lwangaman donjohn.f...@gmail.com wrote:

   I tried working on it again and made a little progress... Now I got
   parent and child selected correctly, but I don't have mouseover
   working for some reason...

  http://jsbin.com/avigi/edit

   On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:

One more detail: mouseout should not take effect until mouseup.
In fact, right now, if I click and begin to drag, then still holding
the mouse button I leave the area, and still holding it come back over
the cells, they no longer get checked / unchecked because mouseout has
already kicked in. Instead it shouldn't kick in until I actually let
go of the mouse button, and I could let go of it anywhere on the page
I suppose, so I guess mouseup would have to be applied to the whole
document.

On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

 I tried something along those lines...

http://jsbin.com/ehedu/edit

 But I just don't have the hang of using this correctly and knowing
 when to refer to dom elements as dom elements or as jquery objects...

 The idea is to tie all events to the container of the checkboxes (i.e.
 table cells), and not to the external container (table or ul list or
 whatever), and yet be able to read and write the value of the
 checkboxes...

 On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

  Taking up jscripter's suggestion, I just noticed myself that 
  applying
  the mousedown and mouseover to the whole table keeps you from being
  able to click on any links that may be contained in the table. For
  example my table has links in the header cells that when clicked
  reorder the table according to that column. Now I can no longer 
  click
  them...
  And, as jscripter says, in the X-Library the mousedown and mouseover
  was applied to the cells containing the checkboxes and not to the
  checkboxes themselves, so that it was enough to click on the cells
  surrounding the checkboxes in order to get them checked / unchecked.

  Ricardo do you think you could manage something like that? (I'm only
  an apprentice and I don't have your expertice!)

  On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

   Hey - this is great work - I just happened to be looking for this
   functionality.

   How would you apply what you have done here to re-writing the 
   original
   X-library code that uses TDs for the checkbox label?

   Thanks!

   On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

Sure! I have a few other plugins I also want to upload, I'll do 
that.

I took the time to rewrite it more carefully. No more binding/
unbinding, a single var, all namespaced and bugs ironed out (if 
you
put the cursor away while holding the button, the mouseover 
would
remain active even after mouseup).

The advantage of namespacing is you can easily remove all event
handlers. I included that in the plugin, in the example you can 
use $
('ul').dragCheck(false) to disable it completely.

   http://jsbin.com/amoxi/edit

cheers,
- ricardo

On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

 @Ricardo
 Do you think it could be useful to add this to the jquery 
 plugins at
 plugins.jquery.com? I'd say it could be put under your name 
 because
 you 

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan


If you wrap your form in a div I think it should work - haven't tested
it

R



On Apr 13, 10:22 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 Could this be a jQuery bug?

 On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:

  I still haven't figured it out, but playing around and setting the
  ajax response as a jquery object, $(html), and making it global so I
  can view it's attributes through Firebug, I was able to locate the
  form element on the ajax response. It was the index-5 element for your
  test page. My sample code below. Though this still doesn't help as to
  why we can't reference it using #test2, maybe someone else can get
  something more out of it.

  I've also tried appended the response to the page and still no go.

  --

  var globalHTML;  // global variable

  $(document).ready(function() {

          $.ajax({
                  url: 'http://www.puc.edu/dev/tests/linking-test',
                  type: 'GET',
                  success: function(html) {
                          var $html = $(html);  // wrap response as jquery 
  object

                          globalHTML = $html;  // check object with firebug

                          alert( $html.get(5).action );
                  }
          });

  });

  Using Firebug and looking at the attributes of the object I've found
  that the form is on the 5th-index of the object, for your test page.
  Though this still doesn't really help much

  alert( $(html).get(5).action );

  On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

   Ok, my test now reflects your suggestions.  But, sadly, none of that
   helped, it is still returning undefined. :(

   On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

Hey Nic,

I have a couple small recommendations- hopefully one will fix the issue.

Try using $.get() instead of $.ajax, and specify type option as 
html-
alternatively, you can use $.load() if your ultimate purpose is to 
inject
this HTML into DOM.

In addition rather than using find(), just select by ID as a subset of 
the
DOM node..

alert($(html).find(#test) becomes
alert($(#test, html));

Hope some of this helps... cheers!

Nic Luciano
Senior Web Developer @ 
AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com 
wrote:

 Nope, that does not work either.

 On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
  Maybe try:

  success: function(html){
    alert($(html).find('form').attr('action'));

  I had some issues in the past using form id's with the jquery form
  plugin, but usually getting it using 'form' worked.

  That said, since the response isn't in the DOM yet, I'm not sure if 
  that
  might present an issue (too/instead).

  - Jack

  Nic Hubbard wrote:
   Yes, this is very odd. I have tried it quite a few ways, but I can
   never target the form.  Any other ideas?

   It is frustrating because I really need to target a form in the 
   html
   response...

   On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

   That's strange. I can't get it to work either and I'm getting 
   the same
   results as you (I can get #test2, but not #test). I've even 
   truncated
   the response down to as if you're only receiving the form part 
   and
   it still doesn't work. I'd be interested in seeing what happens 
   here
   too.

   On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

   Test page to show the 
   problem:http://www.puc.edu/dev/tests/ajax-test

   On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

   I am pulling my hair out over this.  I swear that this is a 
   bug.

   For some reason, I CANNOT target any forms within the html 
   response.
   I have tried very simple examples and it still won't work.  
   Here is
   what I have, that still returns undefined:

   HTML:
   form id=test action=http://test.com;
   span id=test2this is my text/span
   /form

   jQuery:
   success: function(html){
     alert($(html).find(#test).attr('action'));
     alert($(html).find(#test2).text());

   }

   #test2 works, but #test never does, and it seems this is 
   because it
 is
   a form.  Have I done something wrong here?  Can I not target a 
   form?

   On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   I have an ajax GET call that returns the HTML of a page on my
 server.
   Within that page is a form with a specific ID.  I know it is 
   there,
 I
   can see it in the response in Firebug, but when I try to get
   attributes of that ID, it always returns undefined!  What 
   have I
 done
   wrong here?


[jQuery] [treeview] suppressing toggle on link click

2009-04-13 Thread Christopher Litsinger

I'm using the jquery.treeview plugin to build an outline.  Each
element within the outline has a link to the side of it that runs a
javascript function.  I'd like to have users click on this without
triggering the toggle of the element.

Below is a very simple html file that shows the problem- each element
has a [+] to the side of it- when you click on that link, in addition
to the alert, the group will expand or contract.  Any ideas how to
suppress that when clicking on the [+], but allow it when clicking on
the text itself?


html
head
script src='jquery/jquery.js' type='text/javascript'/script
script src='jquery/jquery-treeview/jquery.treeview.js' type='text/
javascript'/script
script src='jquery/jquery.cookie.js' type='text/javascript'/script
script language=JavaScript
$(document).ready(function(){
$(#outline).treeview({
animated: fast,
collapsed: false,
unique: false,
persist: cookie,
toggle: function() {
window.console  console.log(%o was toggled, this);
}
});
});

/script
link rel=stylesheet href=jquery/jquery-treeview/
jquery.treeview.css type=text/css media=screen /

/head
body
ul id=outline class=treeview-red
  lispantop element a href=javascript:void(0); onClick=alert
('hi');[+]/a/span
ul
lispanlevel 1 element 1a href=javascript:void(0);
onClick=alert('hi');[+]/a/span
  ul
  lispanlevel 2 element 1 a href=javascript:void(0);
onClick=alert('hi');[+]/a/span/li
  lispanlevel 2 element 2 a href=javascript:void(0);
onClick=alert('hi');');[+]/a/span
  /ul
/li
/ul
/body
/html


[jQuery] Coda Slider and FancyZoom problem

2009-04-13 Thread Kyle

Hey Folks:

I'm trying to implement a version of FancyZoom with Coda Slider.  What
happens is when you click on the fancyzoom link it moves the slider
backwards in FF/Opera - works fine in Safari 4.

To get the panel to slide backwards you'll need to have it already
advanced forward a panel or two - otherwise it will look like nothing
happened.

Here's my example: 
http://stacksdesign.com/beta/jquery%20tests/slide%20with%20zoom/combined.html

Here's the version of FancyZoom I used:
http://github.com/jnunemaker/fancy-zoom/tree/78e83432cf136e94cd61ced97511a2f35ae8bf40/jquery

I would love some help...

THANKS!
~Kyle~


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Hey, that actually worked!  But, why would this have helped?  And, is
there a way around this, since the real form that I need to get, I
cannot wrap a div around.

On Apr 13, 2:46 pm, Ryan ryank...@gmail.com wrote:
 If you wrap your form in a div I think it should work - haven't tested
 it

 R

 On Apr 13, 10:22 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  Could this be a jQuery bug?

  On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:

   I still haven't figured it out, but playing around and setting the
   ajax response as a jquery object, $(html), and making it global so I
   can view it's attributes through Firebug, I was able to locate the
   form element on the ajax response. It was the index-5 element for your
   test page. My sample code below. Though this still doesn't help as to
   why we can't reference it using #test2, maybe someone else can get
   something more out of it.

   I've also tried appended the response to the page and still no go.

   --

   var globalHTML;  // global variable

   $(document).ready(function() {

           $.ajax({
                   url: 'http://www.puc.edu/dev/tests/linking-test',
                   type: 'GET',
                   success: function(html) {
                           var $html = $(html);  // wrap response as jquery 
   object

                           globalHTML = $html;  // check object with firebug

                           alert( $html.get(5).action );
                   }
           });

   });

   Using Firebug and looking at the attributes of the object I've found
   that the form is on the 5th-index of the object, for your test page.
   Though this still doesn't really help much

   alert( $(html).get(5).action );

   On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

Ok, my test now reflects your suggestions.  But, sadly, none of that
helped, it is still returning undefined. :(

On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

 Hey Nic,

 I have a couple small recommendations- hopefully one will fix the 
 issue.

 Try using $.get() instead of $.ajax, and specify type option as 
 html-
 alternatively, you can use $.load() if your ultimate purpose is to 
 inject
 this HTML into DOM.

 In addition rather than using find(), just select by ID as a subset 
 of the
 DOM node..

 alert($(html).find(#test) becomes
 alert($(#test, html));

 Hope some of this helps... cheers!

 Nic Luciano
 Senior Web Developer @ 
 AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

 On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com 
 wrote:

  Nope, that does not work either.

  On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
   Maybe try:

   success: function(html){
     alert($(html).find('form').attr('action'));

   I had some issues in the past using form id's with the jquery form
   plugin, but usually getting it using 'form' worked.

   That said, since the response isn't in the DOM yet, I'm not sure 
   if that
   might present an issue (too/instead).

   - Jack

   Nic Hubbard wrote:
Yes, this is very odd. I have tried it quite a few ways, but I 
can
never target the form.  Any other ideas?

It is frustrating because I really need to target a form in the 
html
response...

On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

That's strange. I can't get it to work either and I'm getting 
the same
results as you (I can get #test2, but not #test). I've even 
truncated
the response down to as if you're only receiving the form 
part and
it still doesn't work. I'd be interested in seeing what 
happens here
too.

On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

Test page to show the 
problem:http://www.puc.edu/dev/tests/ajax-test

On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

I am pulling my hair out over this.  I swear that this is a 
bug.

For some reason, I CANNOT target any forms within the html 
response.
I have tried very simple examples and it still won't work.  
Here is
what I have, that still returns undefined:

HTML:
form id=test action=http://test.com;
span id=test2this is my text/span
/form

jQuery:
success: function(html){
  alert($(html).find(#test).attr('action'));
  alert($(html).find(#test2).text());

}

#test2 works, but #test never does, and it seems this is 
because it
  is
a form.  Have I done something wrong here?  Can I not target 
a form?

On Apr 12, 4:35 pm, Nic Hubbard nnhubb...@gmail.com wrote:

I have 

[jQuery] Sortable + Resizable + Ajaxify

2009-04-13 Thread robertaugustin

I'm having this issue I need to solve, using the jQuery plugin Ajaxify
alongside with a couple jQuery UI Core functions.

Scenario:
- 4 parent ULs in a row, where child LI elements are sortables
- Ajaxify plugin spawns new LI in corresponding UL by clicking a link
above that UL
- the LI element that is being created by clicking this link is a
separate PHP file.

So far so good - that works just fine. Now I want to make it possible
to resize these LIs across the four ULs (using a grid), while
preventing overlapping of LI elements, and keeping the sortable
function in place.

I assume this works well when the sortable/resizable elements are not
Ajax elements but native/pre-existent. The problem is that as soon as
I add the resizable function to the li.php file that makes up a LI
element, the sortable function stops working (resizing does work
though).

Has anybody worked in a similar environment before, or tried to
accomplish a similar task? I could post the code for both the parent
file and the child LI elements here if needed - please let me know.
I'm open for suggestions or completely different solutions as well!

Thanks in advance.


[jQuery] Re: Validation plugin remote problem

2009-04-13 Thread Victorr

Sure. I translated the error messages to english so that you would
understand :)
http://betan.midoo.se

On 13 Apr, 16:28, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Could you post a testpage? Can't see anything wrong in the snippets
 you provided - its probably something seemingly unrelated.

 Jörn

 On Sun, Apr 12, 2009 at 4:18 PM, Victorr victor.ry...@gmail.com wrote:

  Ok. But what do i need too echo to get a false value and an error
  message?

  thanks!

  On 12 Apr, 10:37, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
  You need to echo true for a valid value.

  Jörn

  On Sun, Apr 12, 2009 at 1:02 AM, Victorr victor.ry...@gmail.com wrote:

   I'm using CakePHP, jQuery and the validation plugin. I'm having some
   problems. I'm trying to check if a email is already in use but I can't
   seem to get it too work.

   I'm just trying to get a error message to see that it works but I
   can't seem to get it right.

   Javascript:

   $(document).ready(function() {
          $(#UserIndexForm).validate({
                  rules: {
                          data[User][email]: {
                                  required: true,
                                  email: true,
                                  remote: /
                          },
                          data[User][passwrd]: {
                                  required: true,
                                  minlength: 5
                          },
                  },
                  messages: {
                          data[User][email]: {
                                  required: Du måste ange en e-post 
   adress.,
                                  email: Du måste ange en giltig e-post 
   adress.,
                                  remote: E-post adressen du angav är 
   upptagen.
                          },
                          data[User][passwrd]: {
                                  required: Du måste ange ett lösenord.,
                                  minlength: Ditt lösenord måste vara 
   minst 5 tecken.
                          }
                  }
          });
   });

   And the controller:

                  if ($this-RequestHandler-isAjax()  
   !empty($_REQUEST['data']
   ['User']['email'])) {
                          $valid = 'false';
                          echo $valid;
                  }

   Thanks!


[jQuery] data: null in $.ajax() settings object results in no Content-length header (FF3)

2009-04-13 Thread rmurp...@gmail.com

Just experienced this in Firefox 3, not sure whether it is desired
behavior, but discussed it with a fellow dev and we think it is not.

I had an ajax request as follows:

var myData = null;

$.ajax({
  'url' : 'foo.php',
  'data' : myData,
  'type' : 'POST',
  'dataType' : 'json',
  'success' : function(j) {
// whatever
  }
});

Client was reporting a 411 HTTP response code on the request -- their
proxy was expecting a Content-length header on the request, and wasn't
getting one. This also occurred if myData was undefined. It did *not*
occur when myData was {}.

We hadn't detected this error internally because our requests weren't
proxy'd. It seems Content-length should always be there, and should be
0 if myData is null or undefined. However, I'm not sure whether this
is just a Firefox issue, or something that jQuery should address in
the spirit of abstracting away browser differences?


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan


In that case you would need to add something like

html = 'div'+html+'/div';

to your function. Its a bit of an ugly hack I know.

Having played with it a bit now. I think your probably right about it
being a jquery bug. It might be worthwhile exploring which function
the problem lies with then submitting it to the jquery team.

R



On Apr 13, 10:55 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 Hey, that actually worked!  But, why would this have helped?  And, is
 there a way around this, since the real form that I need to get, I
 cannot wrap a div around.

 On Apr 13, 2:46 pm, Ryan ryank...@gmail.com wrote:

  If you wrap your form in a div I think it should work - haven't tested
  it

  R

  On Apr 13, 10:22 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   Could this be a jQuery bug?

   On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:

I still haven't figured it out, but playing around and setting the
ajax response as a jquery object, $(html), and making it global so I
can view it's attributes through Firebug, I was able to locate the
form element on the ajax response. It was the index-5 element for your
test page. My sample code below. Though this still doesn't help as to
why we can't reference it using #test2, maybe someone else can get
something more out of it.

I've also tried appended the response to the page and still no go.

--

var globalHTML;  // global variable

$(document).ready(function() {

        $.ajax({
                url: 'http://www.puc.edu/dev/tests/linking-test',
                type: 'GET',
                success: function(html) {
                        var $html = $(html);  // wrap response as 
jquery object

                        globalHTML = $html;  // check object with 
firebug

                        alert( $html.get(5).action );
                }
        });

});

Using Firebug and looking at the attributes of the object I've found
that the form is on the 5th-index of the object, for your test page.
Though this still doesn't really help much

alert( $(html).get(5).action );

On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

 Ok, my test now reflects your suggestions.  But, sadly, none of that
 helped, it is still returning undefined. :(

 On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

  Hey Nic,

  I have a couple small recommendations- hopefully one will fix the 
  issue.

  Try using $.get() instead of $.ajax, and specify type option as 
  html-
  alternatively, you can use $.load() if your ultimate purpose is to 
  inject
  this HTML into DOM.

  In addition rather than using find(), just select by ID as a subset 
  of the
  DOM node..

  alert($(html).find(#test) becomes
  alert($(#test, html));

  Hope some of this helps... cheers!

  Nic Luciano
  Senior Web Developer @ 
  AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

  On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard nnhubb...@gmail.com 
  wrote:

   Nope, that does not work either.

   On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
Maybe try:

success: function(html){
  alert($(html).find('form').attr('action'));

I had some issues in the past using form id's with the jquery 
form
plugin, but usually getting it using 'form' worked.

That said, since the response isn't in the DOM yet, I'm not 
sure if that
might present an issue (too/instead).

- Jack

Nic Hubbard wrote:
 Yes, this is very odd. I have tried it quite a few ways, but 
 I can
 never target the form.  Any other ideas?

 It is frustrating because I really need to target a form in 
 the html
 response...

 On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

 That's strange. I can't get it to work either and I'm 
 getting the same
 results as you (I can get #test2, but not #test). I've even 
 truncated
 the response down to as if you're only receiving the form 
 part and
 it still doesn't work. I'd be interested in seeing what 
 happens here
 too.

 On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com wrote:

 Test page to show the 
 problem:http://www.puc.edu/dev/tests/ajax-test

 On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com wrote:

 I am pulling my hair out over this.  I swear that this is 
 a bug.

 For some reason, I CANNOT target any forms within the html 
 response.
 I have tried very simple examples and it still won't work. 
  Here is
 what I have, that still returns undefined:

 HTML:
 form 

[jQuery] jQuery Form Plugin Problem: IE7 gives Object doesn't support property or method

2009-04-13 Thread MeanStudios

Greetings,

I'm using jQuery 1.3.2 and jQuery Form Plugin 2.25.
My code:
$('#msre_file').change(function(){
el = $(this);
target = el.next();
$('#entryform').ajaxSubmit({
url: '?php echo $cp_url; ?ms_rel_file=upload',
type: 'post',
iframe: true,
success: function(response) {
el.attr('value', '');
target.append('div class=msre_tmp_upload
style=display:none;'+response+'/div');
target.children('.msre_tmp_upload').fadeIn();
}
});
return false;
});

The form tag looks like:
form action=index.php?C=editamp;M=new_entry name=entryform
id=entryform method=post

It works in FF2/3, Safari, IE8 but not in IE7.  I get an error on line
257 which is:
form.submit();

I've changed that line to document.entryform.submit(); just for kicks
and it still throws the error message.
I've also done window.document.getElementById('entryform').submit();
and it still doesn't work.
I've done alert(document.entryform.msre_file.value); and it gives me
the value of the file input correctly so I know it's referencing the
form correctly.
Yes I've changed the name attribute of the submit button to something
other than submit.

I've also scrapped the jQuery Form Plugin and wrote my own form submit
function using the iframe method and it too worked in FF, Safari and
IE8 but still threw the same error in IE7.

I'm getting rather frustrated with this :(.

Any help would be hugely appreciated.


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

Yeah, but my page returns a full HTML page, so I need to do something
like:

$(body).wrapInner('div/div');

Which, does not seem to work.

On Apr 13, 3:14 pm, Ryan ryank...@gmail.com wrote:
 In that case you would need to add something like

 html = 'div'+html+'/div';

 to your function. Its a bit of an ugly hack I know.

 Having played with it a bit now. I think your probably right about it
 being a jquery bug. It might be worthwhile exploring which function
 the problem lies with then submitting it to the jquery team.

 R

 On Apr 13, 10:55 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  Hey, that actually worked!  But, why would this have helped?  And, is
  there a way around this, since the real form that I need to get, I
  cannot wrap a div around.

  On Apr 13, 2:46 pm, Ryan ryank...@gmail.com wrote:

   If you wrap your form in a div I think it should work - haven't tested
   it

   R

   On Apr 13, 10:22 pm, Nic Hubbard nnhubb...@gmail.com wrote:

Could this be a jQuery bug?

On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:

 I still haven't figured it out, but playing around and setting the
 ajax response as a jquery object, $(html), and making it global so I
 can view it's attributes through Firebug, I was able to locate the
 form element on the ajax response. It was the index-5 element for your
 test page. My sample code below. Though this still doesn't help as to
 why we can't reference it using #test2, maybe someone else can get
 something more out of it.

 I've also tried appended the response to the page and still no go.

 --

 var globalHTML;  // global variable

 $(document).ready(function() {

         $.ajax({
                 url: 'http://www.puc.edu/dev/tests/linking-test',
                 type: 'GET',
                 success: function(html) {
                         var $html = $(html);  // wrap response as 
 jquery object

                         globalHTML = $html;  // check object with 
 firebug

                         alert( $html.get(5).action );
                 }
         });

 });

 Using Firebug and looking at the attributes of the object I've found
 that the form is on the 5th-index of the object, for your test page.
 Though this still doesn't really help much

 alert( $(html).get(5).action );

 On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

  Ok, my test now reflects your suggestions.  But, sadly, none of that
  helped, it is still returning undefined. :(

  On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

   Hey Nic,

   I have a couple small recommendations- hopefully one will fix the 
   issue.

   Try using $.get() instead of $.ajax, and specify type option as 
   html-
   alternatively, you can use $.load() if your ultimate purpose is 
   to inject
   this HTML into DOM.

   In addition rather than using find(), just select by ID as a 
   subset of the
   DOM node..

   alert($(html).find(#test) becomes
   alert($(#test, html));

   Hope some of this helps... cheers!

   Nic Luciano
   Senior Web Developer @ 
   AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

   On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard 
   nnhubb...@gmail.com wrote:

Nope, that does not work either.

On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
 Maybe try:

 success: function(html){
   alert($(html).find('form').attr('action'));

 I had some issues in the past using form id's with the jquery 
 form
 plugin, but usually getting it using 'form' worked.

 That said, since the response isn't in the DOM yet, I'm not 
 sure if that
 might present an issue (too/instead).

 - Jack

 Nic Hubbard wrote:
  Yes, this is very odd. I have tried it quite a few ways, 
  but I can
  never target the form.  Any other ideas?

  It is frustrating because I really need to target a form in 
  the html
  response...

  On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

  That's strange. I can't get it to work either and I'm 
  getting the same
  results as you (I can get #test2, but not #test). I've 
  even truncated
  the response down to as if you're only receiving the 
  form part and
  it still doesn't work. I'd be interested in seeing what 
  happens here
  too.

  On Apr 13, 6:47 am, Nic Hubbard nnhubb...@gmail.com 
  wrote:

  Test page to show the 
  problem:http://www.puc.edu/dev/tests/ajax-test

  On Apr 13, 9:33 am, Nic Hubbard nnhubb...@gmail.com 
  wrote:

  I am pulling my hair 

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan

In my tests wrapping your full test html page in the div seems to
work. Not pretty but works.




On Apr 13, 11:29 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 Yeah, but my page returns a full HTML page, so I need to do something
 like:

 $(body).wrapInner('div/div');

 Which, does not seem to work.

 On Apr 13, 3:14 pm, Ryan ryank...@gmail.com wrote:

  In that case you would need to add something like

  html = 'div'+html+'/div';

  to your function. Its a bit of an ugly hack I know.

  Having played with it a bit now. I think your probably right about it
  being a jquery bug. It might be worthwhile exploring which function
  the problem lies with then submitting it to the jquery team.

  R

  On Apr 13, 10:55 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   Hey, that actually worked!  But, why would this have helped?  And, is
   there a way around this, since the real form that I need to get, I
   cannot wrap a div around.

   On Apr 13, 2:46 pm, Ryan ryank...@gmail.com wrote:

If you wrap your form in a div I think it should work - haven't tested
it

R

On Apr 13, 10:22 pm, Nic Hubbard nnhubb...@gmail.com wrote:

 Could this be a jQuery bug?

 On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:

  I still haven't figured it out, but playing around and setting the
  ajax response as a jquery object, $(html), and making it global so I
  can view it's attributes through Firebug, I was able to locate the
  form element on the ajax response. It was the index-5 element for 
  your
  test page. My sample code below. Though this still doesn't help as 
  to
  why we can't reference it using #test2, maybe someone else can get
  something more out of it.

  I've also tried appended the response to the page and still no go.

  --

  var globalHTML;  // global variable

  $(document).ready(function() {

          $.ajax({
                  url: 'http://www.puc.edu/dev/tests/linking-test',
                  type: 'GET',
                  success: function(html) {
                          var $html = $(html);  // wrap response as 
  jquery object

                          globalHTML = $html;  // check object with 
  firebug

                          alert( $html.get(5).action );
                  }
          });

  });

  Using Firebug and looking at the attributes of the object I've found
  that the form is on the 5th-index of the object, for your test page.
  Though this still doesn't really help much

  alert( $(html).get(5).action );

  On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

   Ok, my test now reflects your suggestions.  But, sadly, none of 
   that
   helped, it is still returning undefined. :(

   On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

Hey Nic,

I have a couple small recommendations- hopefully one will fix 
the issue.

Try using $.get() instead of $.ajax, and specify type option 
as html-
alternatively, you can use $.load() if your ultimate purpose is 
to inject
this HTML into DOM.

In addition rather than using find(), just select by ID as a 
subset of the
DOM node..

alert($(html).find(#test) becomes
alert($(#test, html));

Hope some of this helps... cheers!

Nic Luciano
Senior Web Developer @ 
AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard 
nnhubb...@gmail.com wrote:

 Nope, that does not work either.

 On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
  Maybe try:

  success: function(html){
    alert($(html).find('form').attr('action'));

  I had some issues in the past using form id's with the 
  jquery form
  plugin, but usually getting it using 'form' worked.

  That said, since the response isn't in the DOM yet, I'm not 
  sure if that
  might present an issue (too/instead).

  - Jack

  Nic Hubbard wrote:
   Yes, this is very odd. I have tried it quite a few ways, 
   but I can
   never target the form.  Any other ideas?

   It is frustrating because I really need to target a form 
   in the html
   response...

   On Apr 13, 11:45 am, James james.gp@gmail.com wrote:

   That's strange. I can't get it to work either and I'm 
   getting the same
   results as you (I can get #test2, but not #test). I've 
   even truncated
   the response down to as if you're only receiving the 
   form part and
   it still doesn't work. I'd be interested in seeing what 
   happens here
   too.

  

[jQuery] Re: Validation plugin remote problem

2009-04-13 Thread Jörn Zaefferer
The response for the remote request is wrong:
http://betan.midoo.se/?data%5BUser%5D%5Bemail%5D=bla%40bla.com
That should be just true, nothing else.

And, completely unrelated: The error message isn't hidden for a valid
field. You can check the state of the field in Firebug. Once its
valid, the error-class is removed. But the error label isn't hidden,
for whatever reason.

To debug this, please include an uncompressed jquery.validate.js file
and enable the debug option (debug:true).

Jörn

On Tue, Apr 14, 2009 at 12:06 AM, Victorr victor.ry...@gmail.com wrote:

 Sure. I translated the error messages to english so that you would
 understand :)
 http://betan.midoo.se

 On 13 Apr, 16:28, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 Could you post a testpage? Can't see anything wrong in the snippets
 you provided - its probably something seemingly unrelated.

 Jörn

 On Sun, Apr 12, 2009 at 4:18 PM, Victorr victor.ry...@gmail.com wrote:

  Ok. But what do i need too echo to get a false value and an error
  message?

  thanks!

  On 12 Apr, 10:37, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
  You need to echo true for a valid value.

  Jörn

  On Sun, Apr 12, 2009 at 1:02 AM, Victorr victor.ry...@gmail.com wrote:

   I'm using CakePHP, jQuery and the validation plugin. I'm having some
   problems. I'm trying to check if a email is already in use but I can't
   seem to get it too work.

   I'm just trying to get a error message to see that it works but I
   can't seem to get it right.

   Javascript:

   $(document).ready(function() {
          $(#UserIndexForm).validate({
                  rules: {
                          data[User][email]: {
                                  required: true,
                                  email: true,
                                  remote: /
                          },
                          data[User][passwrd]: {
                                  required: true,
                                  minlength: 5
                          },
                  },
                  messages: {
                          data[User][email]: {
                                  required: Du måste ange en e-post 
   adress.,
                                  email: Du måste ange en giltig e-post 
   adress.,
                                  remote: E-post adressen du angav är 
   upptagen.
                          },
                          data[User][passwrd]: {
                                  required: Du måste ange ett lösenord.,
                                  minlength: Ditt lösenord måste vara 
   minst 5 tecken.
                          }
                  }
          });
   });

   And the controller:

                  if ($this-RequestHandler-isAjax()  
   !empty($_REQUEST['data']
   ['User']['email'])) {
                          $valid = 'false';
                          echo $valid;
                  }

   Thanks!


[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Nic Hubbard

You are right, that did work.  Thanks, I really appreciate your help
on this!

Had you run into this issue before?

On Apr 13, 3:33 pm, Ryan ryank...@gmail.com wrote:
 In my tests wrapping your full test html page in the div seems to
 work. Not pretty but works.

 On Apr 13, 11:29 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  Yeah, but my page returns a full HTML page, so I need to do something
  like:

  $(body).wrapInner('div/div');

  Which, does not seem to work.

  On Apr 13, 3:14 pm, Ryan ryank...@gmail.com wrote:

   In that case you would need to add something like

   html = 'div'+html+'/div';

   to your function. Its a bit of an ugly hack I know.

   Having played with it a bit now. I think your probably right about it
   being a jquery bug. It might be worthwhile exploring which function
   the problem lies with then submitting it to the jquery team.

   R

   On Apr 13, 10:55 pm, Nic Hubbard nnhubb...@gmail.com wrote:

Hey, that actually worked!  But, why would this have helped?  And, is
there a way around this, since the real form that I need to get, I
cannot wrap a div around.

On Apr 13, 2:46 pm, Ryan ryank...@gmail.com wrote:

 If you wrap your form in a div I think it should work - haven't tested
 it

 R

 On Apr 13, 10:22 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  Could this be a jQuery bug?

  On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:

   I still haven't figured it out, but playing around and setting the
   ajax response as a jquery object, $(html), and making it global 
   so I
   can view it's attributes through Firebug, I was able to locate the
   form element on the ajax response. It was the index-5 element for 
   your
   test page. My sample code below. Though this still doesn't help 
   as to
   why we can't reference it using #test2, maybe someone else can get
   something more out of it.

   I've also tried appended the response to the page and still no go.

   --

   var globalHTML;  // global variable

   $(document).ready(function() {

           $.ajax({
                   url: 'http://www.puc.edu/dev/tests/linking-test',
                   type: 'GET',
                   success: function(html) {
                           var $html = $(html);  // wrap response as 
   jquery object

                           globalHTML = $html;  // check object with 
   firebug

                           alert( $html.get(5).action );
                   }
           });

   });

   Using Firebug and looking at the attributes of the object I've 
   found
   that the form is on the 5th-index of the object, for your test 
   page.
   Though this still doesn't really help much

   alert( $(html).get(5).action );

   On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

Ok, my test now reflects your suggestions.  But, sadly, none of 
that
helped, it is still returning undefined. :(

On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

 Hey Nic,

 I have a couple small recommendations- hopefully one will fix 
 the issue.

 Try using $.get() instead of $.ajax, and specify type 
 option as html-
 alternatively, you can use $.load() if your ultimate purpose 
 is to inject
 this HTML into DOM.

 In addition rather than using find(), just select by ID as a 
 subset of the
 DOM node..

 alert($(html).find(#test) becomes
 alert($(#test, html));

 Hope some of this helps... cheers!

 Nic Luciano
 Senior Web Developer @ 
 AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

 On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard 
 nnhubb...@gmail.com wrote:

  Nope, that does not work either.

  On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com wrote:
   Maybe try:

   success: function(html){
     alert($(html).find('form').attr('action'));

   I had some issues in the past using form id's with the 
   jquery form
   plugin, but usually getting it using 'form' worked.

   That said, since the response isn't in the DOM yet, I'm 
   not sure if that
   might present an issue (too/instead).

   - Jack

   Nic Hubbard wrote:
Yes, this is very odd. I have tried it quite a few 
ways, but I can
never target the form.  Any other ideas?

It is frustrating because I really need to target a 
form in the html
response...

On Apr 13, 11:45 am, James james.gp@gmail.com 
wrote:

That's strange. I can't get it to work either and I'm 
getting 

[jQuery] Re: Finding ID within Ajax response

2009-04-13 Thread Ryan


Glad I could help. I haven't seen this problem before even though it
does seem like quite a common thing to need to do.

I think with a bit more work you could come up with a more elegant
work around such as using the append/prepend function in conjunction
with say the body and /body tags. Although whatever you use will
be a bit of a hack and at the end of the day as long as you get the
data you need thats all that matters.

Cheers R






On Apr 13, 11:39 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 You are right, that did work.  Thanks, I really appreciate your help
 on this!

 Had you run into this issue before?

 On Apr 13, 3:33 pm, Ryan ryank...@gmail.com wrote:

  In my tests wrapping your full test html page in the div seems to
  work. Not pretty but works.

  On Apr 13, 11:29 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   Yeah, but my page returns a full HTML page, so I need to do something
   like:

   $(body).wrapInner('div/div');

   Which, does not seem to work.

   On Apr 13, 3:14 pm, Ryan ryank...@gmail.com wrote:

In that case you would need to add something like

html = 'div'+html+'/div';

to your function. Its a bit of an ugly hack I know.

Having played with it a bit now. I think your probably right about it
being a jquery bug. It might be worthwhile exploring which function
the problem lies with then submitting it to the jquery team.

R

On Apr 13, 10:55 pm, Nic Hubbard nnhubb...@gmail.com wrote:

 Hey, that actually worked!  But, why would this have helped?  And, is
 there a way around this, since the real form that I need to get, I
 cannot wrap a div around.

 On Apr 13, 2:46 pm, Ryan ryank...@gmail.com wrote:

  If you wrap your form in a div I think it should work - haven't 
  tested
  it

  R

  On Apr 13, 10:22 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   Could this be a jQuery bug?

   On Apr 13, 2:13 pm, James james.gp@gmail.com wrote:

I still haven't figured it out, but playing around and setting 
the
ajax response as a jquery object, $(html), and making it global 
so I
can view it's attributes through Firebug, I was able to locate 
the
form element on the ajax response. It was the index-5 element 
for your
test page. My sample code below. Though this still doesn't help 
as to
why we can't reference it using #test2, maybe someone else can 
get
something more out of it.

I've also tried appended the response to the page and still no 
go.

--

var globalHTML;  // global variable

$(document).ready(function() {

        $.ajax({
                url: 
'http://www.puc.edu/dev/tests/linking-test',
                type: 'GET',
                success: function(html) {
                        var $html = $(html);  // wrap response 
as jquery object

                        globalHTML = $html;  // check object 
with firebug

                        alert( $html.get(5).action );
                }
        });

});

Using Firebug and looking at the attributes of the object I've 
found
that the form is on the 5th-index of the object, for your test 
page.
Though this still doesn't really help much

alert( $(html).get(5).action );

On Apr 13, 10:28 am, Nic Hubbard nnhubb...@gmail.com wrote:

 Ok, my test now reflects your suggestions.  But, sadly, none 
 of that
 helped, it is still returning undefined. :(

 On Apr 13, 1:03 pm, Nic Luciano adaptive...@gmail.com wrote:

  Hey Nic,

  I have a couple small recommendations- hopefully one will 
  fix the issue.

  Try using $.get() instead of $.ajax, and specify type 
  option as html-
  alternatively, you can use $.load() if your ultimate 
  purpose is to inject
  this HTML into DOM.

  In addition rather than using find(), just select by ID as 
  a subset of the
  DOM node..

  alert($(html).find(#test) becomes
  alert($(#test, html));

  Hope some of this helps... cheers!

  Nic Luciano
  Senior Web Developer @ 
  AdaptiveBluehttp://www.twitter.com/niclucianohttp://www.linkedin.com/in/nicluciano

  On Mon, Apr 13, 2009 at 3:35 PM, Nic Hubbard 
  nnhubb...@gmail.com wrote:

   Nope, that does not work either.

   On Apr 13, 12:20 pm, Jack Killpatrick j...@ihwy.com 
   wrote:
Maybe try:

success: function(html){
  alert($(html).find('form').attr('action'));

I had some issues in the past using form id's with the 
jquery form
plugin, but 

[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread Lwangaman

Ok I fixed the text selection problem, in fact different browsers act
differently.

http://jsbin.com/ijebi/edit

Also fixed the correct application of some of the events, in fact it
wasn't mouseup on the document that was screwing nono but the way I
was selecting elements on mousedown without referring to the
selector variable.

On 13 Apr, 23:12, jscripter pc88m...@gmail.com wrote:
 Looks good under Firefox and Opera except that when I click-n-drag I
 am also selecting text. I'm still not sure how the original code
 avoided that.

 Under Chrome is't not working at all. :-(

 On Apr 13, 2:30 pm, Lwangaman donjohn.f...@gmail.com wrote:

  I think I've done it.

 http://jsbin.com/adixe/edit

  I have also left out the mouseleave event, and applied the mouseup to
  the whole document instead of to the table, that way even if I leave
  the table but still have the mouse button down, I don't lose the value
  in the variable. Only if I let go of the mouse button (on or off the
  table) do I reset the variable.

  @Ricardo and @jscripter: does this work good?

  On 13 Apr, 14:41, Lwangaman donjohn.f...@gmail.com wrote:

   I tried working on it again and made a little progress... Now I got
   parent and child selected correctly, but I don't have mouseover
   working for some reason...

  http://jsbin.com/avigi/edit

   On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:

One more detail: mouseout should not take effect until mouseup.
In fact, right now, if I click and begin to drag, then still holding
the mouse button I leave the area, and still holding it come back over
the cells, they no longer get checked / unchecked because mouseout has
already kicked in. Instead it shouldn't kick in until I actually let
go of the mouse button, and I could let go of it anywhere on the page
I suppose, so I guess mouseup would have to be applied to the whole
document.

On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

 I tried something along those lines...

http://jsbin.com/ehedu/edit

 But I just don't have the hang of using this correctly and knowing
 when to refer to dom elements as dom elements or as jquery objects...

 The idea is to tie all events to the container of the checkboxes (i.e.
 table cells), and not to the external container (table or ul list or
 whatever), and yet be able to read and write the value of the
 checkboxes...

 On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

  Taking up jscripter's suggestion, I just noticed myself that 
  applying
  the mousedown and mouseover to the whole table keeps you from being
  able to click on any links that may be contained in the table. For
  example my table has links in the header cells that when clicked
  reorder the table according to that column. Now I can no longer 
  click
  them...
  And, as jscripter says, in the X-Library the mousedown and mouseover
  was applied to the cells containing the checkboxes and not to the
  checkboxes themselves, so that it was enough to click on the cells
  surrounding the checkboxes in order to get them checked / unchecked.

  Ricardo do you think you could manage something like that? (I'm only
  an apprentice and I don't have your expertice!)

  On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

   Hey - this is great work - I just happened to be looking for this
   functionality.

   How would you apply what you have done here to re-writing the 
   original
   X-library code that uses TDs for the checkbox label?

   Thanks!

   On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

Sure! I have a few other plugins I also want to upload, I'll do 
that.

I took the time to rewrite it more carefully. No more binding/
unbinding, a single var, all namespaced and bugs ironed out (if 
you
put the cursor away while holding the button, the mouseover 
would
remain active even after mouseup).

The advantage of namespacing is you can easily remove all event
handlers. I included that in the plugin, in the example you can 
use $
('ul').dragCheck(false) to disable it completely.

   http://jsbin.com/amoxi/edit

cheers,
- ricardo

On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

 @Ricardo
 Do you think it could be useful to add this to the jquery 
 plugins at
 plugins.jquery.com? I'd say it could be put under your name 
 because
 you did all the big work!

 On 12 Apr, 14:35, Lwangaman donjohn.f...@gmail.com wrote:

  Ok that works better, I just changed clicked.checked = 
  !isChecked to
  clicked.checked = isChecked:

 http://jsbin.com/idihi/edit

  On 12 Apr, 08:11, Ricardo ricardob...@gmail.com wrote:

   The 

[jQuery] Re: Endeavour: translating X-Library functionality click-n-drag checkboxes into Jquery

2009-04-13 Thread Lwangaman

Latest version works with both ul lists and with tables:

http://jsbin.com/aqefu/edit

On 14 Apr, 00:51, Lwangaman donjohn.f...@gmail.com wrote:
 Ok I fixed the text selection problem, in fact different browsers act
 differently.

 http://jsbin.com/ijebi/edit

 Also fixed the correct application of some of the events, in fact it
 wasn't mouseup on the document that was screwing nono but the way I
 was selecting elements on mousedown without referring to the
 selector variable.

 On 13 Apr, 23:12, jscripter pc88m...@gmail.com wrote:

  Looks good under Firefox and Opera except that when I click-n-drag I
  am also selecting text. I'm still not sure how the original code
  avoided that.

  Under Chrome is't not working at all. :-(

  On Apr 13, 2:30 pm, Lwangaman donjohn.f...@gmail.com wrote:

   I think I've done it.

  http://jsbin.com/adixe/edit

   I have also left out the mouseleave event, and applied the mouseup to
   the whole document instead of to the table, that way even if I leave
   the table but still have the mouse button down, I don't lose the value
   in the variable. Only if I let go of the mouse button (on or off the
   table) do I reset the variable.

   @Ricardo and @jscripter: does this work good?

   On 13 Apr, 14:41, Lwangaman donjohn.f...@gmail.com wrote:

I tried working on it again and made a little progress... Now I got
parent and child selected correctly, but I don't have mouseover
working for some reason...

   http://jsbin.com/avigi/edit

On 13 Apr, 02:43, Lwangaman donjohn.f...@gmail.com wrote:

 One more detail: mouseout should not take effect until mouseup.
 In fact, right now, if I click and begin to drag, then still holding
 the mouse button I leave the area, and still holding it come back over
 the cells, they no longer get checked / unchecked because mouseout has
 already kicked in. Instead it shouldn't kick in until I actually let
 go of the mouse button, and I could let go of it anywhere on the page
 I suppose, so I guess mouseup would have to be applied to the whole
 document.

 On 13 Apr, 02:33, Lwangaman donjohn.f...@gmail.com wrote:

  I tried something along those lines...

 http://jsbin.com/ehedu/edit

  But I just don't have the hang of using this correctly and knowing
  when to refer to dom elements as dom elements or as jquery 
  objects...

  The idea is to tie all events to the container of the checkboxes 
  (i.e.
  table cells), and not to the external container (table or ul list or
  whatever), and yet be able to read and write the value of the
  checkboxes...

  On 13 Apr, 01:13, Lwangaman donjohn.f...@gmail.com wrote:

   Taking up jscripter's suggestion, I just noticed myself that 
   applying
   the mousedown and mouseover to the whole table keeps you from 
   being
   able to click on any links that may be contained in the table. For
   example my table has links in the header cells that when clicked
   reorder the table according to that column. Now I can no longer 
   click
   them...
   And, as jscripter says, in the X-Library the mousedown and 
   mouseover
   was applied to the cells containing the checkboxes and not to the
   checkboxes themselves, so that it was enough to click on the cells
   surrounding the checkboxes in order to get them checked / 
   unchecked.

   Ricardo do you think you could manage something like that? (I'm 
   only
   an apprentice and I don't have your expertice!)

   On 12 Apr, 22:31, jscripter pc88m...@gmail.com wrote:

Hey - this is great work - I just happened to be looking for 
this
functionality.

How would you apply what you have done here to re-writing the 
original
X-library code that uses TDs for the checkbox label?

Thanks!

On Apr 12, 2:04 pm, Ricardo ricardob...@gmail.com wrote:

 Sure! I have a few other plugins I also want to upload, I'll 
 do that.

 I took the time to rewrite it more carefully. No more binding/
 unbinding, a single var, all namespaced and bugs ironed out 
 (if you
 put the cursor away while holding the button, the mouseover 
 would
 remain active even after mouseup).

 The advantage of namespacing is you can easily remove all 
 event
 handlers. I included that in the plugin, in the example you 
 can use $
 ('ul').dragCheck(false) to disable it completely.

http://jsbin.com/amoxi/edit

 cheers,
 - ricardo

 On Apr 12, 9:48 am, Lwangaman donjohn.f...@gmail.com wrote:

  @Ricardo
  Do you think it could be useful to add this to the jquery 
  plugins at
  plugins.jquery.com? I'd say it could be put under your name 
  because
  you did all the big work!

  On 12 Apr, 

[jQuery] Re: Trouble passing additional data with getJSON

2009-04-13 Thread Kathryn

Well, I solved the problem, but not by using getJSON. Here's the
solution, in case it's helpful to anyone else. I found a page that
lists a fourth undocumented (according to them--didn't have time to
verify) parameter of $.post(), and that is the data type.

http://thecodecentral.com/2007/11/20/the-missing-parameter-of-jquerypost

I changed getJSON to post, specified the datatype as json, changed
request.querystring to request.form in the asp file, and it worked. I
may never know why the other one didn't work, but thank goodness this
one is working.

Cheers,
Kathryn

On Apr 13, 4:14 pm, Kathryn kathry...@gmail.com wrote:
 Hi all,

 I think I must be making an obvious mistake, but I can't see it. I'm
 trying to pass additional data to the server with getJSON, but it's
 not working.

 Here's my function:

 $(document).ready(function() {
         $('#submit_uid').click(function() {
           $.getJSON('pwreset_proc.asp',{check_type: 'verify_uid', uid: $
 ('#uid').val(), ajax: 'true'}, function(json){
           alert(json);
            });
      });

 });

 Here's the form, with the button referenced in the click function:

 form method=post name=enter_uid
 ID: input name=uid id=uid type=text
 input name=submit_uid id=submit_uid type=button value=Submit
 /form

 Here's the code in pwreset_proc.asp:

 dim check_type, uid
 check_type = request.QueryString(check_type)
 uid = request.QueryString(uid)
 (this is followed by an SQL query that uses the passed data)

 When I click Submit, the form just fails quietly.

 To see if the problem was in the asp page, I hard coded the variables,
 and the page works fine. So then I tried the asp code above followed
 by
 response.write(check_type)
 response.end()

 and the page came up blank. So it appears that the data is not being
 passed from the form to the asp page.

 The thing is, I have used a similar function on another page and it
 works fine. The only difference is that it's attached to the change
 event of a dropdown rather than the click event of a button. What am I
 missing???

 Thanks!

 Kathryn


[jQuery] Re: serialScroll option : start -- no effect

2009-04-13 Thread Ariel Flesler

Can you provide a demo online ?

Cheers
--
Ariel Flesler

On Apr 10, 6:17 am, Niels niels.siem...@gmail.com wrote:
 We're using the serialScroll method and using some of the options.
 Only the option start has no effect.

 We want to scroll at the start to element 2 and not to the default
 position 0

 Suggestions?

         $('#technical').serialScroll({
                 target:'#technical-sections',
                 items:'li', // Selector to the items ( relative to the matched
 elements, '#sections' in this case )
                 axis:'x',// The default is 'y' scroll on both ways
                 navigation:'#technical-navigation li a',
                 duration:900,// Length of the animation (if you scroll 2 axes 
 and
 use queue, then each axis take half this time)
                 force: true, // Force a scroll to the element specified by
 'start' (some browsers don't reset on refreshes)
                 constant: false, // constant speed
                 lock:false, // Ignore events if already animating (true by 
 default)
                 //prev:'img.prev',// Selector to the 'prev' button (absolute!,
 meaning it's relative to the document)
                 //next:'img.next',// Selector to the 'next' button (absolute 
 too)
                 //queue:false,// We scroll on both axes, scroll both at the 
 same
 time.
                 //event:'click',// On which event to react (click is the 
 default,
 you probably won't need to specify it)
                 //stop:false,// Each click will stop any previous animations 
 of the
 target. (false by default)
                 //lock:true, // Ignore events if already animating (true by
 default)
                 start: 2, // On which element (index) to begin ( 0 is the 
 default,
 redundant in this case )
                 //cycle:true,// Cycle endlessly ( constant velocity, true is 
 the
 default )
                 //step:1, // How many items to scroll each time ( 1 is the 
 default,
 no need to specify )
                 jump:true, // If true, items become clickable (or w/e 'event' 
 is,
 and when activated, the pane scrolls to them)
                 //lazy:false,// (default) if true, the plugin looks for the 
 items on
 each event(allows AJAX or JS content, or reordering)
                 //interval:1000, // It's the number of milliseconds to 
 automatically
 go to the next


[jQuery] Re: jQuery Cycle plugin - addslide (again)

2009-04-13 Thread ppblaauw

Maybe the issue is really addSlide in combination with slideExpr.

When images are added they are prepended instead of appended.

So the issue will be how to use slideExpr with addSlide.

If more info is needed, please let me know

On Apr 13, 8:12 am, ppblaauw ppbla...@gmail.com wrote:
 I read a lot of posts about this issue, but can not find a solution.
 Also have seen the addSlide examples for the jQuerycycleplugin.

 I try to add slides to thecycleplugin with AJAX, one slide at a time
 with the following code.

   function onBefore(curr, next, opts, fwd) {
     // on Before arguments:
     //  curr == DOM element for the slide that is currently being
 displayed
     //  next == DOM element for the slide that is about to be
 displayed
     //  opts == slideshow options
     //  fwd  == true if cycling forward, false if cycling backward

     //Slide html creation helper.
     function ddblockGetSlideHTML(slideImg) {
       return 'img src=' + slideImg + ' width=200 height=200
 alt=/';
     };

     opts.ajaxLoadSlides = 1; // Will be set later from UI
     opts.totalSlideCount = 6; //Will be set later from UI
     //load slides dynamically
     if (opts.ajaxLoadSlides) {

       // on the first pass, addSlide is undefined (plugin hasn't yet
 created the fn);
       // when we're finshed adding slides we'll null it out again
       if (!opts.addSlide){
         return;
       }

       if (opts.nextSlide + 1 == opts.totalSlideCount) {
         // final slide in our slide slideshow is about to be displayed
         // so there are no more to fetch
         alert('last slide to be dislayed, nothing to add anymore');
         opts.addSlide = null;
         return;
       }

       // Retrieve slide from server via AJAX, call; if successful the
       // anonymous function in voteSaved is run.
       $.ajax({
         type: 'POST', // Use the POST method.
         url: 'get_image_slides',
         dataType: 'json',
         data:
 {js:true,origin:'ddblock',curr_slide:opts.currSlide,next_slide:opts.nextSli 
 de,delta:opts.ddblocknr},
         success: function(data) {
           // add our next slide
           opts.addSlide(ddblockGetSlideHTML(data.slideImg), fwd ==
 true);
         },
         error: function(xhr) {
           //alert('Error: ' + xhr.status + ' ' + xhr.statusText);
         }
       });
     }
   }

 I first have 2 initial images
 after that, images are loaded with AJAX
 The ajax call returns the image ok
 The problem is that opts.currSlide and opts.Nextslide give strange
 values so the wrong images are selected.
 When I look in FF console the post values for currSlide and nextSlide
 are.

 0 - 1
 2 - 1
 2 - 3
 4 - 1
 2 - 3
 4 - 5

 I get the images in the PHP script on nextSlide +2
 So i expect :
 0 - 1 - get image 3
 1 - 2 - get image 4
 2 - 3 - get image 5
 3 - 4 - get image 6

 Another problem is I use slideExpr to select the right content to
 slide.
 How can I you use addslide to add slides to the SlideExpr.parent

 Thanks in advance for any help with this issue

 Philip Blaauw


[jQuery] Check value when adding to array

2009-04-13 Thread Nic Hubbard

I have input values that I am adding to a array.  I would like to be
able to check if any of them end in _test and if so, I need to set a
specific value.  Is there any, in an if statement, to check if an
attribute of one of the input fields ends with _test?

main_form.find('input').each(function() {
  arr_current_item2.push($(this).attr('name') + '=' + $(this).val());
});// End each


[jQuery] Re: Check value when adding to array

2009-04-13 Thread Nic Hubbard

Tried the following, but did not seem to work:

if ($(input[name*='delete_linkid'],this)) {
   alert('it does!');
}

On Apr 13, 5:27 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 I have input values that I am adding to a array.  I would like to be
 able to check if any of them end in _test and if so, I need to set a
 specific value.  Is there any, in an if statement, to check if an
 attribute of one of the input fields ends with _test?

 main_form.find('input').each(function() {
   arr_current_item2.push($(this).attr('name') + '=' + $(this).val());

 });// End each


[jQuery] Re: jQuery Form Plugin Problem: IE7 gives Object doesn't support property or method

2009-04-13 Thread MeanStudios

Update:

I am using ExpressionEngine and am trying to edit to the publish area
(for those of you wondering) and I have no control over the name
attribute for the submit button and it's value is submit so I've
used jQuery to change the name of the submit button to something else
with this line of code:
$(input[name='submit']).attr('name', 'change_submit');

This works for FF, Safari and IE8 but it seems IE7 doesn't pick up
that change and still things the button is named submit.  I've used
the developer tool in the IE8 browser to check the DOM when it's
rendering in IE7 and it shows as 'change_submit' there so I'm not sure
what's up.

I've hacked the cp.publish.php file to manually change the submit
buttons name to something else and everything is working now.  So, the
problem is IE7 doesn't accept the button name change using jQuery.
Maybe if I remove that button and rebuild it?

On Apr 14, 8:23 am, MeanStudios cody.lundqu...@gmail.com wrote:
 Greetings,

 I'm using jQuery 1.3.2 and jQuery Form Plugin 2.25.
 My code:
         $('#msre_file').change(function(){
                 el = $(this);
                 target = el.next();
                 $('#entryform').ajaxSubmit({
                         url: '?php echo $cp_url; ?ms_rel_file=upload',
                         type: 'post',
                         iframe: true,
                         success: function(response) {
                                 el.attr('value', '');
                                 target.append('div class=msre_tmp_upload
 style=display:none;'+response+'/div');
                                 target.children('.msre_tmp_upload').fadeIn();
                         }
                 });
                 return false;
         });

 The form tag looks like:
 form action=index.php?C=editamp;M=new_entry name=entryform
 id=entryform method=post

 It works in FF2/3, Safari, IE8 but not in IE7.  I get an error on line
 257 which is:
 form.submit();

 I've changed that line to document.entryform.submit(); just for kicks
 and it still throws the error message.
 I've also done window.document.getElementById('entryform').submit();
 and it still doesn't work.
 I've done alert(document.entryform.msre_file.value); and it gives me
 the value of the file input correctly so I know it's referencing the
 form correctly.
 Yes I've changed the name attribute of the submit button to something
 other than submit.

 I've also scrapped the jQuery Form Plugin and wrote my own form submit
 function using the iframe method and it too worked in FF, Safari and
 IE8 but still threw the same error in IE7.

 I'm getting rather frustrated with this :(.

 Any help would be hugely appreciated.


[jQuery] Re: jQuery Form Plugin Problem: IE7 gives Object doesn't support property or method

2009-04-13 Thread MeanStudios

Second Update:

If you remove the name attribute from the button using jQuery then it
works. Just changing the name does not.

All fixed.

On Apr 14, 11:01 am, MeanStudios cody.lundqu...@gmail.com wrote:
 Update:

 I am using ExpressionEngine and am trying to edit to the publish area
 (for those of you wondering) and I have no control over the name
 attribute for the submit button and it's value is submit so I've
 used jQuery to change the name of the submit button to something else
 with this line of code:
 $(input[name='submit']).attr('name', 'change_submit');

 This works for FF, Safari and IE8 but it seems IE7 doesn't pick up
 that change and still things the button is named submit.  I've used
 the developer tool in the IE8 browser to check the DOM when it's
 rendering in IE7 and it shows as 'change_submit' there so I'm not sure
 what's up.

 I've hacked the cp.publish.php file to manually change the submit
 buttons name to something else and everything is working now.  So, the
 problem is IE7 doesn't accept the button name change using jQuery.
 Maybe if I remove that button and rebuild it?

 On Apr 14, 8:23 am, MeanStudios cody.lundqu...@gmail.com wrote:

  Greetings,

  I'm using jQuery 1.3.2 and jQuery Form Plugin 2.25.
  My code:
          $('#msre_file').change(function(){
                  el = $(this);
                  target = el.next();
                  $('#entryform').ajaxSubmit({
                          url: '?php echo $cp_url; ?ms_rel_file=upload',
                          type: 'post',
                          iframe: true,
                          success: function(response) {
                                  el.attr('value', '');
                                  target.append('div class=msre_tmp_upload
  style=display:none;'+response+'/div');
                                  
  target.children('.msre_tmp_upload').fadeIn();
                          }
                  });
                  return false;
          });

  The form tag looks like:
  form action=index.php?C=editamp;M=new_entry name=entryform
  id=entryform method=post

  It works in FF2/3, Safari, IE8 but not in IE7.  I get an error on line
  257 which is:
  form.submit();

  I've changed that line to document.entryform.submit(); just for kicks
  and it still throws the error message.
  I've also done window.document.getElementById('entryform').submit();
  and it still doesn't work.
  I've done alert(document.entryform.msre_file.value); and it gives me
  the value of the file input correctly so I know it's referencing the
  form correctly.
  Yes I've changed the name attribute of the submit button to something
  other than submit.

  I've also scrapped the jQuery Form Plugin and wrote my own form submit
  function using the iframe method and it too worked in FF, Safari and
  IE8 but still threw the same error in IE7.

  I'm getting rather frustrated with this :(.

  Any help would be hugely appreciated.


[jQuery] Re: Check value when adding to array

2009-04-13 Thread Steven Yang
try remove the single quotes

if ($(input[name*=delete_linkid],this)) {
  alert('it does!');


[jQuery] Re: [Autocomplete] help: keyboard selection not working

2009-04-13 Thread Tom Worster

i finally figured this out after a lot of trial and error.

for keyboard navigation of the suggestions menus to work you must have a
style rule for the element li.ac_over defined i your css. i was astonished
when i discovered this but after reading the script i think i have a notion
how this can be.

anyway, there it is. put a rule for li.ac_over in your style sheet.


On 4/6/09 6:52 PM, Tom Worster f...@thefsb.org wrote:

 
 I'm unable to make the keyboard selection of suggestions from the
 dropdown work in my project, otherwise it works fine and selection
 with the mouse is possible.
 
 I'm using safari 3 and ff3. Keyboard selection in the demos is working
 fine, so this seems not to be a browser issue. I've checked that I
 have the newest jquery.autocomplete.js plugin code. I've checked
 through the API docs and demo code and can't find anything that seems
 to enable or disable keyboard selection. I'm stuck and would be
 grateful for help.
 
 Here's the markup:
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://
 www.w3.org/TR/html4/loose.dtd
 html
 head
 titleTest new suggest/title
 script src=jquery.js type=text/javascript/script
 script src=jquery.autocomplete.js type=text/javascript/script
 script src=suggest-test.js type=text/javascript/script
 link href=suggest-test.css rel=stylesheet type=text/css
 /head
 body
 form method=post
   label for=artisttextArtist/labelbr
   pinput type=text id=artisttext name=artist class=auto/
 p
   pinput type=submit name=submitform value=Submit/p
 /form
 /body
 /html
 
 And the script:
 $(document).ready(function() {
 $('#artisttext').autocomplete('suggest-test.php', {extraParams: {p1:
 'as'} });
 $('.auto').setOptions({minChars: 2, delay: 200, max: 50});
 });




[jQuery] Re: Check value when adding to array

2009-04-13 Thread Nic Hubbard

Could you explain this one a little more?  How you coded it is a
little confusing to me.

On Apr 13, 6:34 pm, mkmanning michaell...@gmail.com wrote:
 If I understand you code, you're trying to create an array of
 name=value, with value being specifically set if the name has _test in
 it?

 var arr = $.map($('input'),function(n,i){
         return n.name+'='+(n.name.indexOf('_test')!=-1?'some_value':n.value);

 });

 On Apr 13, 5:27 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  I have input values that I am adding to a array.  I would like to be
  able to check if any of them end in _test and if so, I need to set a
  specific value.  Is there any, in an if statement, to check if an
  attribute of one of the input fields ends with _test?

  main_form.find('input').each(function() {
    arr_current_item2.push($(this).attr('name') + '=' + $(this).val());

  });// End each


[jQuery] Re: Trouble passing additional data with getJSON

2009-04-13 Thread mkmanning

My guess would be you're not returning false anywhere on the form
submit, so the form is submitting.

On Apr 13, 2:14 pm, Kathryn kathry...@gmail.com wrote:
 Hi all,

 I think I must be making an obvious mistake, but I can't see it. I'm
 trying to pass additional data to the server with getJSON, but it's
 not working.

 Here's my function:

 $(document).ready(function() {
         $('#submit_uid').click(function() {
           $.getJSON('pwreset_proc.asp',{check_type: 'verify_uid', uid: $
 ('#uid').val(), ajax: 'true'}, function(json){
           alert(json);
            });
      });

 });

 Here's the form, with the button referenced in the click function:

 form method=post name=enter_uid
 ID: input name=uid id=uid type=text
 input name=submit_uid id=submit_uid type=button value=Submit
 /form

 Here's the code in pwreset_proc.asp:

 dim check_type, uid
 check_type = request.QueryString(check_type)
 uid = request.QueryString(uid)
 (this is followed by an SQL query that uses the passed data)

 When I click Submit, the form just fails quietly.

 To see if the problem was in the asp page, I hard coded the variables,
 and the page works fine. So then I tried the asp code above followed
 by
 response.write(check_type)
 response.end()

 and the page came up blank. So it appears that the data is not being
 passed from the form to the asp page.

 The thing is, I have used a similar function on another page and it
 works fine. The only difference is that it's attached to the change
 event of a dropdown rather than the click event of a button. What am I
 missing???

 Thanks!

 Kathryn


[jQuery] Re: Check value when adding to array

2009-04-13 Thread mkmanning

If I understand you code, you're trying to create an array of
name=value, with value being specifically set if the name has _test in
it?

var arr = $.map($('input'),function(n,i){
return n.name+'='+(n.name.indexOf('_test')!=-1?'some_value':n.value);
});

On Apr 13, 5:27 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 I have input values that I am adding to a array.  I would like to be
 able to check if any of them end in _test and if so, I need to set a
 specific value.  Is there any, in an if statement, to check if an
 attribute of one of the input fields ends with _test?

 main_form.find('input').each(function() {
   arr_current_item2.push($(this).attr('name') + '=' + $(this).val());

 });// End each


[jQuery] Bug in my gallery, wtf?!

2009-04-13 Thread @oscargodson

Before I post a link:

A. Yes, the code is messy, I have been trying to fix this all day, and
I have restructured my code at least a dozen times, and that is why it
is so messy, so please don't say try cleaning it up :)

B. There are 100s of images, I just haven't sliced them all out from
the client's PDF yet, so only pneumatic and vintage load a set of
images.

C. Thumbs don't match with the large images yet, because I haven't sat
down and matched the 100s of images yet, but it works correctly! :)


OK so on with it:
http://boozker.com/beall/

Everything works perfectly ON LOAD! :(

If you click on my custom carousal everything works. thumbs, left, and
right arrows work fine.

The 1 step arrows (ones on the black bar) work fine and even update
the count correctly.

However, ALL of this breaks when I reload with a click like this:
$('#gallery_nav ul a').click(function(){
var new_set = $(this).attr('title').toLowerCase();
$.get(js/get_images.php, { set:new_set }, function(data){
$('#carousel_wrapper ul').empty().append(data);
activate_gallery();
});
});


Here is my window load:
$.get(js/get_images.php, { set:'history' }, function(data){
$('#carousel_wrapper ul').empty().append(data);
activate_gallery();
});


After you click on a new category, it basically run activate_gallery
(); twice, and so when you click next on either arrows it jumps x2. If
you change the category 3x it jumps 3x etc

I KNOW it has to do with activate_gallery but I have NO CLUE how else
to write it. :(

Remember, I have move code chunks all over. Does anyone have any ideas
on how to get this to work?


[jQuery] ajax returns data on ie safari and chrome but not firefox

2009-04-13 Thread Shannon

Can somebody take a look at this...

http://www.churchboom.com/index1.asp

The white my notes section on the bottom left is a div area that is
loaded with an Jquery Ajax call just like 2 other areas on the page.
This works fine in IE, Safari (PC), Chrome but not in Firefox. It just
shows blank white.

Any ideas?


[jQuery] innerfade problem

2009-04-13 Thread atomicweb

Hello,

Trying to use the innerfade script, but it doesn't seem to do
anything. The page I'm trying to use it on is:

http://bikesonthebricks.com/jquerytest.html

I copied the call at the top right from the innerfade site, and the
div I'm trying to affect is just a div with a set of images inside it,
so I can't see what could go wrong, but it obviously has.  Any help
would be greatly appreciated, thanks.

Here is my call, I've just got it in the head for now:

script type=text/javascript
   $(document).ready(
function(){
$('.slideshow2').innerfade({
animationtype: 'fade',
speed: 750,
timeout: 2000,
type: 'random',
containerheight: '275px'
});

});
/script


[jQuery] Re: jQuery 1.3.2 breaks tablesorter zebra, here's a fix

2009-04-13 Thread Gregory Foster

You guys rock, thanks for the fix.  I ran into the same code as
zaylril in Tablesorter 2.03.

gf


[jQuery] Final Four: Grabbing Keys, Styling Columns, Pop Up Forms, Edit Select Lists?

2009-04-13 Thread briandus

Hi there -  I am using jqGrid with ASP.NET and while it has really
taken me quite some time to get this integration playing nicely, now
that I've finally got things moving, I am so pleased. But, I have four
things that I am still having some trouble with...

#1)
I have a table with some hidden fields...the key field is hidden and
named (ID). In order to get the field to send along with the rest of
the edit parameters, I had to show the field, but then it shows up as
editable on the form. When I set 'editable' to false, it no longer
exists on the field. More importantly, however, is that there is a
lower case id being sent along with the oper parameter. The id
field being passed is the row id in the table, not the key field. How
can I grab and pass the key field?

#2)
Since I have enabled editing, everytime I refresh my page, the Add
record Dialog Box always displays. How can I turn this off?

#3)
How can I style the checkbox column as well as the column with the
Plus sign icon indicating a sub grid? Both of these columns are much
wider than they need to be.

#4)
When I edit a record, the select lists are dynamically populated with
the correct values as per the colModel, but they are not the existing
values on the record. For example, if I am editing a record with a
field value of ON, the edit form shows a select list with OFF and
ON, but the selected value is OFF...rather than the value already
exisitng on the record. How can I correct this?

thanks so much for such a uber wonderful plug in!! :-)


[jQuery] Simple innerFade problem

2009-04-13 Thread atomicweb

Hello,

I'm trying to use the innerfade script, and I'm not sure what's going
wrong - it seems so simple but it's still not working.  Here is a link
to the page:

http://bikesonthebricks.com/jquerytest.html

Here is the call, which I've just stuck in the page head for now:

script type=text/javascript
   $(document).ready(
function(){
$('.slideshow2').innerfade({
animationtype: 'fade',
speed: 750,
timeout: 2000,
type: 'random',
containerheight: '275px'
});

});
/script

And here is the div I'm trying to turn into a slideshow, just a div
with a set of images inside:

div class=slideshow2
img src=images/contests/contests_slideshow_01.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_02.jpg 
alt=bikes on
the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_03.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_04.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_05.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_06.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_07.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_08.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_09.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_10.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_11.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
img src=images/contests/contests_slideshow_12.jpg
alt=bikes on the bricks 2008 width=350 height=275 /
/div


[jQuery] Re: Adding incremental numbered classes to divs

2009-04-13 Thread Brain Lava

Thanks everyone!  You've definitely made some great points for me to
consider.  I'm really new to scripting (normally I can find plugins to
do what I want) and you're probably right that there is a much easier
solution to what I'm trying to achieve.

I'm going to take your suggestions and see what I can figure out on my
own.  If I can achieve the effect I'm desiring I'll post the end
result for some feedback.

Cheers!

On Apr 9, 5:54 pm, mkmanning michaell...@gmail.com wrote:
 Since you're not using the class for styling, but indexing, why not
 just use the natural index of the div in its container, or from the
 jQuery object itself?

 $('.ngg-gallery-thumbnail-box') is an array-like object, so you can
 iterate over it, or access its members by index number, such as $
 ('.ngg-gallery-thumbnail-box').get(8).

 If you're building a carousel, adding incremental numbers to the
 classname to drive the carousel seems overkill.

 On Apr 9, 11:54 am, Brain Lava nic...@brainlava.com wrote:

  Normally I would agree with you but the effect I'm trying to achieve
  is based on the location of the image in the grid and not tied to the
  image itself.  I don't want the end user to have to update the CSS
  every time they move an image or add a new one to their gallery.  This
  seemed like the best way to achieve my end result.

  On Apr 9, 9:37 am, brian bally.z...@gmail.com wrote:

   That seems like you're fighting against the convention. Why create a
   zillion classes when these same divs already have an incremented ID?
   (The ID being the proper place to do this sort of thin, in the 1st
   place)

   On Thu, Apr 9, 2009 at 1:31 AM, Brain Lava nic...@brainlava.com wrote:

I'm really new to jQuery and have been struggling with a concept that
I would think is pretty simple but I can't seem to find anything
online that does what I need.

I'm using NextGen Gallery for Wordpress and I would like to assign an
incremental class to each div that the gallery outputs.  For example
the gallery gives me the following code:

div id=ngg-gallery-1 class=ngg-galleryoverview
  div id=ngg-image-99 class=ngg-gallery-thumbnail-box/div
  div id=ngg-image-55 class=ngg-gallery-thumbnail-box/div
  div id=ngg-image-95 class=ngg-gallery-thumbnail-box/div
/div

What I would like to do is replace the append class of the interior
divs with a number that automatically increments by 1:
div id=ngg-gallery-1 class=ngg-galleryoverview
  div id=ngg-image-99 class=ngg-gallery-thumbnail-box-1/div
  div id=ngg-image-55 class=ngg-gallery-thumbnail-box-2/div
  div id=ngg-image-95 class=ngg-gallery-thumbnail-box-3/div
/div

I've seen this done in carousel scripts but I can't seem to figure out
how they do it.

Any help would be greatly apprecaited.


[jQuery] Re: Adding incremental numbered classes to divs

2009-04-13 Thread Brain Lava

Thanks everyone!  You've definitely made some great points for me to
consider.  I'm really new to scripting (normally I can find plugins to
do what I want) and you're probably right that there is a much easier
solution to what I'm trying to achieve.

I'm going to take your suggestions and see what I can figure out on my
own.  If I can achieve the effect I'm desiring I'll post the end
result for some feedback.

Cheers!

On Apr 9, 5:54 pm, mkmanning michaell...@gmail.com wrote:
 Since you're not using the class for styling, but indexing, why not
 just use the natural index of the div in its container, or from the
 jQuery object itself?

 $('.ngg-gallery-thumbnail-box') is an array-like object, so you can
 iterate over it, or access its members by index number, such as $
 ('.ngg-gallery-thumbnail-box').get(8).

 If you're building a carousel, adding incremental numbers to the
 classname to drive the carousel seems overkill.

 On Apr 9, 11:54 am, Brain Lava nic...@brainlava.com wrote:

  Normally I would agree with you but the effect I'm trying to achieve
  is based on the location of the image in the grid and not tied to the
  image itself.  I don't want the end user to have to update the CSS
  every time they move an image or add a new one to their gallery.  This
  seemed like the best way to achieve my end result.

  On Apr 9, 9:37 am, brian bally.z...@gmail.com wrote:

   That seems like you're fighting against the convention. Why create a
   zillion classes when these same divs already have an incremented ID?
   (The ID being the proper place to do this sort of thin, in the 1st
   place)

   On Thu, Apr 9, 2009 at 1:31 AM, Brain Lava nic...@brainlava.com wrote:

I'm really new to jQuery and have been struggling with a concept that
I would think is pretty simple but I can't seem to find anything
online that does what I need.

I'm using NextGen Gallery for Wordpress and I would like to assign an
incremental class to each div that the gallery outputs.  For example
the gallery gives me the following code:

div id=ngg-gallery-1 class=ngg-galleryoverview
  div id=ngg-image-99 class=ngg-gallery-thumbnail-box/div
  div id=ngg-image-55 class=ngg-gallery-thumbnail-box/div
  div id=ngg-image-95 class=ngg-gallery-thumbnail-box/div
/div

What I would like to do is replace the append class of the interior
divs with a number that automatically increments by 1:
div id=ngg-gallery-1 class=ngg-galleryoverview
  div id=ngg-image-99 class=ngg-gallery-thumbnail-box-1/div
  div id=ngg-image-55 class=ngg-gallery-thumbnail-box-2/div
  div id=ngg-image-95 class=ngg-gallery-thumbnail-box-3/div
/div

I've seen this done in carousel scripts but I can't seem to figure out
how they do it.

Any help would be greatly apprecaited.


[jQuery] Re: Custom error function in jQuery Validation plugin?

2009-04-13 Thread cohq82

Can someone help pls Thanks!!

On Apr 12, 12:32 pm, cohq82 quang...@gmail.com wrote:
 I am new to jQuery validation plugin (http://docs.jquery.com/Plugins/
 Validation). What I am trying to do is to have my own error message
 DIV with display:none initially. If there is error, I want to run the
 fadein/fadeout to show that error.

 The structure of the input/error DIV like this:
 divinput/input/div
 divcontext help/div
 diverror msg/div

 The way this plugin works is to insert a LABEL right next to the INPUT
 and this is not what I want. I want to reuse the html code I have in
 the error msg DIV. I tried to look in errorPlacement but not sure how
 to use it. Can someone help?

 Thanks


[jQuery] Re: capture user's selection on a html page

2009-04-13 Thread RobG



On Apr 14, 4:50 am, ihomest...@gmail.com ihomest...@gmail.com
wrote:
 Thanks for the link. This is pretty nice. Is there a special
 javascript even I could capture to get the user's selection?

No.  The page referenced by Andy uses a mouseup listener on the
document.

The script itself is not very robust, it's pretty easy to break -
create a selection, then create another that includes that selection.
It might take a couple of attempts, but it throws an error pretty
readily.  After that, the script stops working.

--
Rob



[jQuery] username validation using jQuery Validation plugin

2009-04-13 Thread cohq82

Hi all,

Is there a way to validate username field (no space, only letters)?
I don't want to modify the code. I know this can be done easily with
if statement but I just want to see if the Validation plugin has this
feature already: 
http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js

Thanks.