[jQuery] UI dialog uses old data

2009-12-14 Thread ebru...@gmail.com
Hello,

I am using the UI dialog plugin. People can edit there dns data off a
domain in this dialog.

When i uses it for the first time everything works fine. But when i
delete 2 of the three rows from the database he shows just one record,
this is oke, but when i submit the data he adds the old data to the
database again!

For some reason he rembers the old data there was the first time i
used the dialog. How is this possible?

My dialog code:

$(function() {
$('#dialog_dnsmanagement').dialog({
bgiframe: true,
resizable: true,
autoResize: true,
width:500,
modal: true,
overlay: {
backgroundColor: '#000',
opacity: 0.5
},
buttons: {
'Annuleren': function() {
$(this).dialog('destroy');
},
'Opslaan': function() {
$(this).dialog('destroy');

var options = {
type: 'POST',
cache: false,
target: '#alert_update_dns',
url: './ajax/ajaxDnsUpdate.php',
success: function(html){
$('#postresult').remove();
}
};

$('#form_dns_update').ajaxSubmit(options);

}
}
});
});

Regards,

Erwin


[jQuery] Re: validate

2009-12-14 Thread sucheta
Rob,

Thanks . I will try this and get back ..

Sucheta

On Dec 12, 1:39 pm, rpinna bpi...@demandfactory.com wrote:
 I have a similar situation with a timepicker control.  I have a text
 input and an image that displays a popup when selected.
 The popup fills the input field when a selection is made.  The
 timepicker control allows me to define a callback whenever this
 occurs.

 I use the callback to force validation as follows:

 function() { $datefield.change(); $myform.validate().element('#'
 +datefieldid); });

 The $datefield, $myform, and datefieldid are all available via closure
 in my case.

 ~Rob

 On Dec 4, 3:41 am, sucheta suchet...@yahoo.com wrote: Hello all,

  I am using the 
  JQueryvalidator fromhttp://bassistance.de/jquery-plugins/jquery-plugin-validation/
  . And I am using the calandar component from YUI.

  The problem is similar to what bobbykjack has .

  I have an input field ,when user clicks into it the calendar pops up.
  When user chooses a date it fills the input box. But the error message
  which had been displayed on clicking the submit button before the
  field was filled  does not go away.

  How do I get rid off it?.

  Thanks in advance .
  Sucheta


[jQuery] Pierzchalski, Brady is out of the office.

2009-12-14 Thread Brady . Pierzchalski

I will be out of the office starting  12/14/2009 and will not return until
12/28/2009.

Please see Cory McCutchin with and urgent issues.

**
CONFIDENTIALITY NOTICE: 
This is a transmission from Kohl's Department Stores, Inc.
and may contain information which is confidential and proprietary.
If you are not the addressee, any disclosure, copying or distribution or use of 
the contents of this message is expressly prohibited.
If you have received this transmission in error, please destroy it and notify 
us immediately at 262-703-7000.

CAUTION:
Internet and e-mail communications are Kohl's property and Kohl's reserves the 
right to retrieve and read any message created, sent and received.  Kohl's 
reserves the right to monitor messages by authorized Kohl's Associates at any 
time
without any further consent.


[jQuery] blockUI after a certain time

2009-12-14 Thread milo
Hi all,
I'd like to start the blockUI only after a certain time; this is
because I don't want to see the blockUI message it if my request takes
0,3 to be served.
Is it possible?
thx

Danilo


[jQuery] Code to remove div when h3 is empty

2009-12-14 Thread mockaccino
Hi, I'm a newbie to the concepts of programming let alone query and I
was wondering if this was possible.

I've got a Wordpress site that has a h3 tag nested inside a div. The
problem is that a post is removed everyday which leaves the h3 empty
but the div is still there taking up real estate making the columns
uneven. So im thinking that there must be something like if h3 is
empty, hide div.classwhatever...

My embarrassing lame attempts don't work and i was wondering if
someone can a tleast point me to the right function to try write
something around.

Thanks for taking the time to read this post.


[jQuery] treeview loads more than 1 subtree with async feature

2009-12-14 Thread gouldtv
I think I may have found a bug with the jQuery treeview plugin:

Steps to reproduce:

1)  Edit the sample source.php file that comes with the plugin to
include a second lazy-loading sub-tree (see below)
2)  Next, run the async demo page.  Click the second async link you
just added.  Go into firebug and look at the net-tab.  Notice how now
when clicking to load the link with id 2, it actually loads #1 AND
#2.

I've got 36 nodes, and I'm finding that they are all loading at once
after clicking to open just one async. node.


snip from source.php file
{
text: 3.4 Taconite and Form (20 min)
},
{
text: 3.5 Server-side JavaScript with jQuery 
and AOLserver (20
min)
},
{
text: 3.6 The Onion: How to add features 
without adding
features (20 min),
id: 1,
hasChildren: true
},
{
text: 3.65 The Onion2: More data, but will 
root #1 load by
accident?,
id: 2,
hasChildren: true
},


[jQuery] JQuery treeview plugin and async fetches for more tree-data

2009-12-14 Thread gouldtv
I'm trying to create a collapsing/expanding animated treeview in
Javascript.  I found the JQuery treeview plugin, and it's working
great.  However, I have one key need that I can seem to figure out
with the samples provided:

Basically I need the advanced async feature they provide (http://
jquery.bassistance.de/treeview/demo/async.html).  As the user clicks
on each main node in the tree, I need to make an AJAX-call to pull
in the sub-tree links.  My problem is that I need to do some post-
processing in JS of the JSON data that comes back from the server in
order to keep the tree-view plugin happy (and I don't control the
API's on the server for the data-source)

When I make my call to the API to retrieve it top-level tree, the JSON
data comes back like this:


navcallback({response:{statusCode:200,data:{genrelist:{genre:
[{id:1,haschildren:true,name:Alternative,parentid:0},{id:
24,haschildren:true,name:Blues,parentid:0},{id:
32,haschildren:true,name:Classical,parentid:0},{id:
44,haschildren:true,name:Country,parentid:0},{id:
212,haschildren:true,name:Decades,parentid:0},{id:
54,haschildren:true,name:Easy Listening,parentid:0},{id:
61,haschildren:true,name:Electronic,parentid:0},{id:
82,haschildren:true,name:Folk,parentid:0},{id:
122,haschildren:true,name:Inspirational,parentid:0},{id:
134,haschildren:true,name:International,parentid:0},{id:
163,haschildren:true,name:Jazz,parentid:0},{id:
177,haschildren:true,name:Latin,parentid:0},{id:
195,haschildren:true,name:Metal,parentid:0},{id:
295,haschildren:false,name:Misc,parentid:0},{id:
206,haschildren:true,name:New Age,parentid:0},{id:
220,haschildren:true,name:Pop,parentid:0},{id:
232,haschildren:true,name:RB/Urban,parentid:0},{id:
110,haschildren:true,name:Rap,parentid:0},{id:
242,haschildren:true,name:Reggae,parentid:0},{id:
250,haschildren:true,name:Rock,parentid:0},{id:
265,haschildren:true,name:Seasonal/Holiday,parentid:0},{id:
276,haschildren:true,name:Soundtracks,parentid:0},{id:
282,haschildren:true,name:Talk,parentid:0},{id:
89,haschildren:true,name:Themes,parentid:
0}]}},statusText:Ok}});


All is well, but I need to do some JS processing on it as it comes
back, so I run it through a script like this:

function navcallback(d) {
var response='[';
for (i=0;i=d.response.data.genrelist.genre.length - 1;i++) {
response += '{text: '+d.response.data.genrelist.genre[i].name
+',id: '+d.response.data.genrelist.genre[i].id+',hasChildren:
true},';
}
response = response.slice(0, -1);
response += ']';
}

Which then gets the data in the format that jQuery treeview expects
it:

[{text: Alternative,id: 1,hasChildren: true},{text:
Blues,id: 24,hasChildren: true},{text: Classical,id:
32,hasChildren: true},{text: Country,id: 44,hasChildren:
true},{text: Decades,id: 212,hasChildren: true},{text:
Easy Listening,id: 54,hasChildren: true},{text:
Electronic,id: 61,hasChildren: true},{text: Folk,id:
82,hasChildren: true},{text: Inspirational,id:
122,hasChildren: true},{text: International,id:
134,hasChildren: true},{text: Jazz,id: 163,hasChildren:
true},{text: Latin,id: 177,hasChildren: true},{text:
Metal,id: 195,hasChildren: true},{text: Misc,id:
295,hasChildren: true},{text: New Age,id:
206,hasChildren: true},{text: Pop,id: 220,hasChildren:
true},{text: RB/Urban,id: 232,hasChildren: true},{text:
Rap,id: 110,hasChildren: true},{text: Reggae,id:
242,hasChildren: true},{text: Rock,id: 250,hasChildren:
true},{text: Seasonal/Holiday,id: 265,hasChildren: true},
{text: Soundtracks,id: 276,hasChildren: true},{text:
Talk,id: 282,hasChildren: true},{text: Themes,id:
89,hasChildren: true}]



However, I can't for the life of me figure out how to get this
integrated with the JQuery treeview's async.js code (below).  All
would be fine if I didn't need to do this post-processing, but I need
to.

Gotcha's that I'm dealing with:

1)  The API data is coming from a cross-domain server, so I think I
probably need to use the $.getScript call to retrieve the JSONp data.
2)  I can't figure out how to get my navback handler integrated into
the load function of treeview.  If I insert my response-
reformatting code inside the getJSON function, all kinds of bad
things start happening.  I suspect it has to do with the this
objects and parent and other things which are quite complex in this
plugin.


function load(settings, root, child, container) {

$.getJSON(settings.url, {root: root}, function(response) {

function createNode(parent) {
mythis = this;
var current = $(li/).attr(id, this.id || 
).html(span +
this.text + /span).appendTo(parent);
if (this.classes) {
current.children(span).addClass(this.classes);
}
if (this.expanded) {
current.addClass(open);
}
if (this.hasChildren || 

[jQuery] selector canbe chain.

2009-12-14 Thread caii
THIS WORK: $(li:lt(8):gt(3):even);
but this did not: $(ul:has(li:eq(3)));


[jQuery] Why is this demo doesn't work?

2009-12-14 Thread zirho
I looked up this page.

now i know that the code in demo is not available anymore.

somehow this link has gone
http://jquery-ui.googlecode.com/svn/trunk/ui/ui.core.js

does anyone know about this?
how can I make this demo work?

thanks


[jQuery] Re: validate

2009-12-14 Thread caii
can't reply??!!

On Dec 14, 6:04 pm, sucheta suchet...@yahoo.com wrote:
 Rob,

 Thanks . I will try this and get back ..

 Sucheta

 On Dec 12, 1:39 pm, rpinna bpi...@demandfactory.com wrote:

  I have a similar situation with a timepicker control.  I have a text
  input and an image that displays a popup when selected.
  The popup fills the input field when a selection is made.  The
  timepicker control allows me to define a callback whenever this
  occurs.

  I use the callback to force validation as follows:

  function() { $datefield.change(); $myform.validate().element('#'
  +datefieldid); });

  The $datefield, $myform, and datefieldid are all available via closure
  in my case.

  ~Rob

  On Dec 4, 3:41 am, sucheta suchet...@yahoo.com wrote: Hello all,

   I am using the 
   JQueryvalidator fromhttp://bassistance.de/jquery-plugins/jquery-plugin-validation/
   . And I am using the calandar component from YUI.

   The problem is similar to what bobbykjack has .

   I have an input field ,when user clicks into it the calendar pops up.
   When user chooses a date it fills the input box. But the error message
   which had been displayed on clicking the submit button before the
   field was filled  does not go away.

   How do I get rid off it?.

   Thanks in advance .
   Sucheta


[jQuery] [tooltip] Tooltip plugin not behaving in IE7

2009-12-14 Thread fredriley
Hi

It looks like the 'quirkiness' of IE is rearing its ugly little head
again, unless I'm doing something really dopey. If you view the test
doc at:

http://www.nottingham.ac.uk/~ntzfr/test/ajax/jquery/jquery_tooltip_plugin_test.html

in a proper browser such as Firefox or Opera, the Tooltip plugin works
fine - hover over the form elements and you get a custom tooltip. View
it in Microsoft's crashware browser and you get a Javascript error:

Object doesn't support this property or method

relating to Line 31, which is:

$(input, select, img, textarea).tooltip({

This happens if I reduce the selectors to one:

$(input).tooltip({

so it obviously doesn't like the selector. Could anyone point me
towards a diagnosis of this, please? Have I got something wrong in the
selector? I'm a relative novice at jQuery.

It's a nice jQuery plugin and I'm in awe of all the plugins Jörn's
developed - I use Autocomplete and Validate on a regular basis, so
many thanks - and would like to use this one as well. If I can't get
IE to behave then I'll have to ditch it, sadly, as when IE falls over
it ceases all other code execution. TIA for any tips :)

Cheers

Fred


Re: [jQuery] Validation Plugin:need help with errorPlacement

2009-12-14 Thread Leonardo K
Try to use the debug:true option to find what's going on. Check if the form
has the id=actionform.

$('#actionform').validate({
debug:true,
submitHandler: function(form) {
$(form).ajaxSubmit({
success: function() {
$('#actionform').hide();
$('#content').append(p class='thanks'Thanks! Your request
has been sent./p
}
});
},
errorPlacement: function(error, element) {
error.insertAfter(.rowElem);
}
});

On Sun, Dec 13, 2009 at 20:52, Gian-ava b...@stylozero.com wrote:


 Hi Leonardo,

 Thanks for answering.

 Unfortunately, the validation doesn't work at all with the code you
 provided: the form is sent even if the required fields are empty.

 Any hint?


 Leonardo K wrote:
 
  This should work:
 
  $(document).ready(function(){
 $('#actionform').validate({
  submitHandler: function(form) {
 $(form).ajaxSubmit({
 success: function() {
 $('#actionform').hide();
$('#content').append(p class='thanks'Thanks!
 Your
  request has been sent./p
  }
});
  },
  errorPlacement: function(error, element) {
  error.insertAfter(.rowElem);
  }
 });
  });
 
  On Sun, Dec 13, 2009 at 18:09, Gian-ava b...@stylozero.com wrote:
 
 
  Oh c'mon, nobody who can helo me out with this?
 
  Nobody who can figure out how to code the right errorPlacement to place
  the
  error label where I need it?
  --
  View this message in context:
 
 http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26769256.html
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.
 
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26770633.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




Re: [jQuery] validation plugin. errorplacement and onblur

2009-12-14 Thread Leonardo K
You can use the errorLabelContainer to put all your label in a div, and the
plugin will handle this.

errorLabelContainer: #messageBox,

On Sun, Dec 13, 2009 at 09:33, Droy droy...@gmail.com wrote:

 Greetings! I had a small problem: all errors received in plugin
 validation I take out in div the block with id = error.

 errorPlacement: function (error) {
$ (' #error ').html (error); }

 All works well. But when the user has corrected the data on correct in
 case of an error errors from the block div it is not removed. It is
 clear, because html - joining.

 As to me to set property: onblur that if there were no errors, in
 the block div already described errors were removed?



Re: [jQuery] Need help converting conventional code to jquery

2009-12-14 Thread Leonardo K
function togglePassFail(radioName) {
var buttonGrp = document.getElementsByName(radioName);
var radioValue = $(buttonGrp).filter(':checked').val();
var detailDiv = $(buttonGrp).eq(0).parent().next();
if ( radioValue == 'p' ){
detailDiv.hide();
}else{
detailDiv.show();
}
}

On Sun, Dec 13, 2009 at 17:55, Ibatex mjgris...@gmail.com wrote:

 Hi all, I'm new here and new to jquery in general.

 Question is how can I do the following in jquery, I'd like to have
 access to jqueries effects and animations.

 function togglePassFail(radioName) {
var buttonGrp = document.getElementsByName(radioName);
var radioValue;

// text input for related details are in a div thats the next
 sibling
 of the parent div of the radio buttons
var detailDiv = buttonGrp[0].parentNode.nextSibling;

// get value of selected radio button
for (var i=0; ibuttonGrp.length; i++) {
if (buttonGrp[i].checked == true) {
radioValue = buttonGrp[i].value;
}
}

// hide if pass is selected, show otherwise
detailDiv.style.display = (radioValue == 'p') ? 'none' : 'block';
 }

 Thanks ahead of time for any help.



Re: [jQuery] Code to remove div when h3 is empty

2009-12-14 Thread Charlie




if the empty h3 tag exists in the DOM you can test the length of text
within it. 

using theoretical class of "postDiv" loop through all the postDiv h3's:

$(".postDiv h3").each(function() { // "each" loops through all
matching selectors one at a time
   if( $(this).text().length==0 ){ // "this" refers to the
individual h3 that is currently within the "each"
$(this).closest(".postDiv").hide() // 'closest" looks up
through parents to find match
   }
});



mockaccino wrote:

  Hi, I'm a newbie to the concepts of programming let alone query and I
was wondering if this was possible.

I've got a Wordpress site that has a h3 tag nested inside a div. The
problem is that a post is removed everyday which leaves the h3 empty
but the div is still there taking up real estate making the columns
uneven. So im thinking that there must be something like "if h3 is
empty, hide div.class"whatever"...

My embarrassing lame attempts don't work and i was wondering if
someone can a tleast point me to the right function to try write
something around.

Thanks for taking the time to read this post.

  





[jQuery] how to get value between brackets in a string

2009-12-14 Thread tony stamp

I have a simple span element with the id of pageCount, which has a value of
(5), for example. I am attempting to get the just number value without the
brackets, or some way of adjusting the number and leaving the brackets. Any
pointers?
-- 
View this message in context: 
http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-tp26777141s27240p26777141.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: [jQuery] how to get value between brackets in a string

2009-12-14 Thread Leonardo K
$('#pageCount').text().replace(')','').replace('(','')

On Mon, Dec 14, 2009 at 10:41, tony stamp tonyst...@hotmail.co.uk wrote:


 I have a simple span element with the id of pageCount, which has a value of
 (5), for example. I am attempting to get the just number value without
 the
 brackets, or some way of adjusting the number and leaving the brackets. Any
 pointers?
 --
 View this message in context:
 http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-tp26777141s27240p26777141.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] Re: IE stops recurring ajax call

2009-12-14 Thread Henjo
Anyone?


[jQuery] Re: Return values

2009-12-14 Thread Rick van Hoeij
because of the async of javascript I normally use callback functions
to do the value passing. So instead of return true or return false in
a ajax function, it's better to call a function with the true or false
as a parameter.

Just my two cents ;)

On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote:
 How deep in the scope can you go in nested functions and still return
 a value? For example:

 $.validator.addMethod('userCheck', function (value) {
     $.ajax({
         type: POST,
         url: _scripts/send_message.php,
         data: action=checkuser username= + value,
         success: function(msg) {
             if (msg) {
                 return false;
             }
             else {
                 return true;
             }
         }
     });

 },);

 Why is´nt this working?

 If i do this:

 //Global
 var result;

 $.validator.addMethod('userCheck', function (value) {
     $.ajax({
         type: POST,
         url: _scripts/send_message.php,
         data: action=checkuser username= + value,
         success: function(msg) {
             if (msg) {
                 result = false;
             }
             else {
                 result = true;
             }
         }
     });
     return result;

 },);

 i get the value back but it does not work properly, It gets the value
 from the textfield but on keyup it's always one letter short... so i
 have to type one more letter to get the right value. I´m stuck on this
 so any help would be greatly appreciated! :)

 Thanks in advance

 George


[jQuery] Re: Why is this demo doesn't work?

2009-12-14 Thread MorningZ
Use one of the links listed on this page instead:

http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery


[jQuery] Re: UI dialog uses old data

2009-12-14 Thread MorningZ
 For some reason he rembers the old data

It's not remembering anything, it's simply reading the values
again...  after you do your save/edit/whatever, use .val() and other
things that set form field values and clear out what is there


[jQuery] Re: Return values

2009-12-14 Thread Jojje
Hi! Yeah i got that tip before but i'm not sure i understand this.
Could you perhaps give me an example with the code below :)

regards

George

On 14 Dec, 14:27, Rick van Hoeij rickvho...@gmail.com wrote:
 because of the async of javascript I normally use callback functions
 to do the value passing. So instead of return true or return false in
 a ajax function, it's better to call a function with the true or false
 as a parameter.

 Just my two cents ;)

 On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote:

  How deep in the scope can you go in nested functions and still return
  a value? For example:

  $.validator.addMethod('userCheck', function (value) {
      $.ajax({
          type: POST,
          url: _scripts/send_message.php,
          data: action=checkuser username= + value,
          success: function(msg) {
              if (msg) {
                  return false;
              }
              else {
                  return true;
              }
          }
      });

  },);

  Why is´nt this working?

  If i do this:

  //Global
  var result;

  $.validator.addMethod('userCheck', function (value) {
      $.ajax({
          type: POST,
          url: _scripts/send_message.php,
          data: action=checkuser username= + value,
          success: function(msg) {
              if (msg) {
                  result = false;
              }
              else {
                  result = true;
              }
          }
      });
      return result;

  },);

  i get the value back but it does not work properly, It gets the value
  from the textfield but on keyup it's always one letter short... so i
  have to type one more letter to get the right value. I´m stuck on this
  so any help would be greatly appreciated! :)

  Thanks in advance

  George


Re: [jQuery] Validation Plugin:need help with errorPlacement

2009-12-14 Thread Gian-ava

Leonardo, thanks for your interest in my case.

I've tried out the code with the debug option. I just don't know what the
debug function will generate and where I need to look to see the result.

Otherwise, again, your code doesn't get validation to work.

This one do work:

$(document).ready(function(){
$('#actionform').validate({
 
 submitHandler: function(form) {
 
   $(form).ajaxSubmit({
success: function() {
$('#actionform').hide();
$('#content').append(p class='thanks'Thanks! Your
request has been sent./p)
}
   });
 }
 
});
});


And, as I mention in my first entry, when I tried to use the
error.insertAfter function, I got what I wanted, only I got for each field
the error messages of all other fields as well. Probably something to do
with the place where I put the function in the code.


Leonardo K wrote:
 
 Try to use the debug:true option to find what's going on. Check if the
 form
 has the id=actionform.
 
 $('#actionform').validate({
 debug:true,
 submitHandler: function(form) {
 $(form).ajaxSubmit({
 success: function() {
 $('#actionform').hide();
 $('#content').append(p class='thanks'Thanks! Your
 request
 has been sent./p
 }
 });
 },
 errorPlacement: function(error, element) {
 error.insertAfter(.rowElem);
 }
 });
 
 On Sun, Dec 13, 2009 at 20:52, Gian-ava b...@stylozero.com wrote:
 

 Hi Leonardo,

 Thanks for answering.

 Unfortunately, the validation doesn't work at all with the code you
 provided: the form is sent even if the required fields are empty.

 Any hint?


 Leonardo K wrote:
 
  This should work:
 
  $(document).ready(function(){
 $('#actionform').validate({
  submitHandler: function(form) {
 $(form).ajaxSubmit({
 success: function() {
 $('#actionform').hide();
$('#content').append(p class='thanks'Thanks!
 Your
  request has been sent./p
  }
});
  },
  errorPlacement: function(error, element) {
  error.insertAfter(.rowElem);
  }
 });
  });
 
  On Sun, Dec 13, 2009 at 18:09, Gian-ava b...@stylozero.com wrote:
 
 
  Oh c'mon, nobody who can helo me out with this?
 
  Nobody who can figure out how to code the right errorPlacement to
 place
  the
  error label where I need it?
  --
  View this message in context:
 
 http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26769256.html
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.
 
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26770633.html
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.


 
 

-- 
View this message in context: 
http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26778043.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



RE: [jQuery] Re: load() function and IE8

2009-12-14 Thread Scott Stewart
Thanks Karl, 

But if it's not supported then why would it work in Firefox?
Secondly, would the bind method be a workaround?

Thanks

sas

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Karl Swedberg
Sent: Monday, December 14, 2009 12:33 AM
To: jQuery (English)
Subject: [jQuery] Re: load() function and IE8

Hi Scott,

Take a look at the documentation for the .live() method:

Currently not supported: blur, focus, mouseenter, mouseleave, change,
submit

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

The change event doesn't bubble in IE, so it doesn't work with .live
(). jQuery 1.4 is going to provide a workaround for that, but as of
1.3.2, it's not supported.

On Dec 10, 5:02 pm, Scott Stewart sstwebwo...@bellsouth.net wrote:
 I fat fingered the last one so...

 I have this piece of code

 $(#AP_PONum).live(change, function(){
    ap_po = $(option:selected,this).val();
 $(#content-box).load(webapps/finished_jewelry/PurReq/display/
 dsp_addPurchaseRequest.cfm?poNum=+ap_po);

 });

 which works like a champ in firefox.

 it's called from a drop down grabs the ColdFusion template and load it
 in a div called content-box.

 This does nothing in IE8, no error, no load, no love.. nothing

 any ideas on how to work around this?



[jQuery] Re: load() function and IE8

2009-12-14 Thread MorningZ
But if it's not supported then why would it work in Firefox? 

working and supported are two different animals

And it works because the change event does bubble events the way
that works with .live(), and, no surprise here, IE doesn't bubble
events the way that works with .live() but apparently some way
around IE's shortcomings is in place for 1.4's implementation of .live
()


On Dec 14, 8:56 am, Scott Stewart sstwebwo...@bellsouth.net wrote:
 Thanks Karl,

 But if it's not supported then why would it work in Firefox?
 Secondly, would the bind method be a workaround?

 Thanks

 sas

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

 Behalf Of Karl Swedberg
 Sent: Monday, December 14, 2009 12:33 AM
 To: jQuery (English)
 Subject: [jQuery] Re: load() function and IE8

 Hi Scott,

 Take a look at the documentation for the .live() method:

 Currently not supported: blur, focus, mouseenter, mouseleave, change,
 submit

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

 The change event doesn't bubble in IE, so it doesn't work with .live
 (). jQuery 1.4 is going to provide a workaround for that, but as of
 1.3.2, it's not supported.

 On Dec 10, 5:02 pm, Scott Stewart sstwebwo...@bellsouth.net wrote:
  I fat fingered the last one so...

  I have this piece of code

  $(#AP_PONum).live(change, function(){
     ap_po = $(option:selected,this).val();
  $(#content-box).load(webapps/finished_jewelry/PurReq/display/
  dsp_addPurchaseRequest.cfm?poNum=+ap_po);

  });

  which works like a champ in firefox.

  it's called from a drop down grabs the ColdFusion template and load it
  in a div called content-box.

  This does nothing in IE8, no error, no load, no love.. nothing

  any ideas on how to work around this?


[jQuery] Re: UI dialog uses old data

2009-12-14 Thread ebru...@gmail.com
Then i think the problem is unique fields.

Thanks for your reply!

On 14 dec, 14:47, MorningZ morni...@gmail.com wrote:
  For some reason he rembers the old data

 It's not remembering anything, it's simply reading the values
 again...  after you do your save/edit/whatever, use .val() and other
 things that set form field values and clear out what is there


RE: [jQuery] Re: load() function and IE8

2009-12-14 Thread Scott Stewart
working and supported are two different animals

This is true...

Back to my particular anomaly...

I just replaced the live call with a bind call, and now there's nothing
in Firefox either.. 

I'm using the Admintasia template
(http://www.admintasia.com). Because of the way this is set up (or the way
that I'm calling things) I've had to use the live function to get things to
work.

I think I'm right in assuming that the live function keeps the Ajax events
alive...

So is there a way to get around this? I can always add a submit button to
every dropdown I'm using but that would kind of defeat the purpose.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of MorningZ
Sent: Monday, December 14, 2009 9:10 AM
To: jQuery (English)
Subject: [jQuery] Re: load() function and IE8

But if it's not supported then why would it work in Firefox? 

working and supported are two different animals

And it works because the change event does bubble events the way
that works with .live(), and, no surprise here, IE doesn't bubble
events the way that works with .live() but apparently some way
around IE's shortcomings is in place for 1.4's implementation of .live
()


On Dec 14, 8:56 am, Scott Stewart sstwebwo...@bellsouth.net wrote:
 Thanks Karl,

 But if it's not supported then why would it work in Firefox?
 Secondly, would the bind method be a workaround?

 Thanks

 sas

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

 Behalf Of Karl Swedberg
 Sent: Monday, December 14, 2009 12:33 AM
 To: jQuery (English)
 Subject: [jQuery] Re: load() function and IE8

 Hi Scott,

 Take a look at the documentation for the .live() method:

 Currently not supported: blur, focus, mouseenter, mouseleave, change,
 submit

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

 The change event doesn't bubble in IE, so it doesn't work with .live
 (). jQuery 1.4 is going to provide a workaround for that, but as of
 1.3.2, it's not supported.

 On Dec 10, 5:02 pm, Scott Stewart sstwebwo...@bellsouth.net wrote:
  I fat fingered the last one so...

  I have this piece of code

  $(#AP_PONum).live(change, function(){
     ap_po = $(option:selected,this).val();
  $(#content-box).load(webapps/finished_jewelry/PurReq/display/
  dsp_addPurchaseRequest.cfm?poNum=+ap_po);

  });

  which works like a champ in firefox.

  it's called from a drop down grabs the ColdFusion template and load it
  in a div called content-box.

  This does nothing in IE8, no error, no load, no love.. nothing

  any ideas on how to work around this?



Re: [jQuery] Validation Plugin:need help with errorPlacement

2009-12-14 Thread Leonardo K
The debug:true only work with firebug (extension for firefox). The messages
will appear in console

On Mon, Dec 14, 2009 at 11:50, Gian-ava b...@stylozero.com wrote:


 Leonardo, thanks for your interest in my case.

 I've tried out the code with the debug option. I just don't know what the
 debug function will generate and where I need to look to see the result.

 Otherwise, again, your code doesn't get validation to work.

 This one do work:

 $(document).ready(function(){
$('#actionform').validate({

 submitHandler: function(form) {

   $(form).ajaxSubmit({
success: function() {
$('#actionform').hide();
$('#content').append(p class='thanks'Thanks! Your
 request has been sent./p)
}
});
 }

});
 });


 And, as I mention in my first entry, when I tried to use the
 error.insertAfter function, I got what I wanted, only I got for each field
 the error messages of all other fields as well. Probably something to do
 with the place where I put the function in the code.


 Leonardo K wrote:
 
  Try to use the debug:true option to find what's going on. Check if the
  form
  has the id=actionform.
 
  $('#actionform').validate({
  debug:true,
  submitHandler: function(form) {
  $(form).ajaxSubmit({
  success: function() {
  $('#actionform').hide();
  $('#content').append(p class='thanks'Thanks! Your
  request
  has been sent./p
  }
  });
  },
  errorPlacement: function(error, element) {
  error.insertAfter(.rowElem);
  }
  });
 
  On Sun, Dec 13, 2009 at 20:52, Gian-ava b...@stylozero.com wrote:
 
 
  Hi Leonardo,
 
  Thanks for answering.
 
  Unfortunately, the validation doesn't work at all with the code you
  provided: the form is sent even if the required fields are empty.
 
  Any hint?
 
 
  Leonardo K wrote:
  
   This should work:
  
   $(document).ready(function(){
  $('#actionform').validate({
   submitHandler: function(form) {
  $(form).ajaxSubmit({
  success: function() {
  $('#actionform').hide();
 $('#content').append(p class='thanks'Thanks!
  Your
   request has been sent./p
   }
 });
   },
   errorPlacement: function(error, element) {
   error.insertAfter(.rowElem);
   }
  });
   });
  
   On Sun, Dec 13, 2009 at 18:09, Gian-ava b...@stylozero.com wrote:
  
  
   Oh c'mon, nobody who can helo me out with this?
  
   Nobody who can figure out how to code the right errorPlacement to
  place
   the
   error label where I need it?
   --
   View this message in context:
  
 
 http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26769256.html
   Sent from the jQuery General Discussion mailing list archive at
   Nabble.com.
  
  
  
  
 
  --
  View this message in context:
 
 http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26770633.html
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.
 
 
 
 

 --
 View this message in context:
 http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26778043.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] Superfish Joomla module: all subs with the same top-value

2009-12-14 Thread joge
hello,

I am using the superfish module for Joomla!

Now I want to align all sub and sub-sub- and so on-menus on the same
vertical position, so they all appear directly underneath the main
menu. How can I do that? The top-values in the css are absolute to
their parent, so entereing a fix value there shouldn't do it...

thanks, Joerg


[jQuery] Re: Getting width of menu outputs incorrect size

2009-12-14 Thread merds
I'm having the same problem. When I get the widths of the LI's in
FireFox or IE7/8 they are correct, but IE6 seems to be given me much
smaller sizes and repeating a lot of the widths as well.

On Dec 7, 8:28 pm, Niels nails.net...@gmail.com wrote:
 Hope someone can help me with this.

 I'm using superfish with the supersubs plugin.

  - Aim -
 To apply a width to a div that contains the menu ul so it can be
 centered using css (auto margins).

  - Method  -
 Added some code tp superfish.js to get the width of the ul (adding
 together widths of each li) which then applies that result to the div.

  - Problem  -
  Its working up to a point. A value is returned but it seems to be too
 small, causing the menu to run over two lines.

  -Edited Superfish Code
 -

 ;(function($){
         $.fn.superfish = function(op){

                 var sf = $.fn.superfish,
                         c = sf.c,
                         $arrow = $(['span class=',c.arrowClass,' 
 #187;/span'].join
 ('')),
                         over = function(){
                                 var $$ = $(this), menu = getMenu($$);
                                 clearTimeout(menu.sfTimer);
                                 
 $$.showSuperfishUl().siblings().hideSuperfishUl();
                         },
                         out = function(){
                                 var $$ = $(this), menu = getMenu($$), o = 
 sf.op;
                                 clearTimeout(menu.sfTimer);
                                 menu.sfTimer=setTimeout(function(){
                                         
 o.retainPath=($.inArray($$[0],o.$path)-1);
                                         $$.hideSuperfishUl();
                                         if (o.$path.length  
 $$.parents(['li.',o.hoverClass].join
 ('')).length1){over.call(o.$path);}
                                 },o.delay);
                         },
                         getMenu = function($menu){
                                 var menu = 
 $menu.parents(['ul.',c.menuClass,':first'].join(''))
 [0];
                                 sf.op = sf.o[menu.serial];
                                 return menu;
                         },
                         addArrow = function($a){ 
 $a.addClass(c.anchorClass).append
 ($arrow.clone()); };

 // inserted code get width of li and apply to ul

                 var ulWidth = 0;
     $(.sf-menu  li  a).each(function(i) {
     ulWidth += $(this).outerWidth(true);
      });
     $(#sf-menu-wrap).css(width, ulWidth);

 // end inserted code

                 return this.each(function() {
                         var s = this.serial = sf.o.length;
                         var o = $.extend({},sf.defaults,op);
                         o.$path = 
 $('li.'+o.pathClass,this).slice(0,o.pathLevels).each
 (function(){
                                 
 $(this).addClass([o.hoverClass,c.bcClass].join(' '))
                                         
 .filter('li:has(ul)').removeClass(o.pathClass);
                         });
                         sf.o[s] = sf.op = o;

                         $('li:has(ul)',this)[($.fn.hoverIntent  
 !o.disableHI) ?
 'hoverIntent' : 'hover'](over,out).each(function() {
                                 if (o.autoArrows) addArrow( 
 $('a:first-child',this) );
                         })
                         .not('.'+c.bcClass)
                                 .hideSuperfishUl();

                         var $a = $('a',this);
                         $a.each(function(i){
                                 var $li = $a.eq(i).parents('li');
                                 
 $a.eq(i).focus(function(){over.call($li);}).blur(function()
 {out.call($li);});
                         });
                         o.onInit.call(this);

                 }).each(function() {
                         var menuClasses = [c.menuClass];
                         if (sf.op.dropShadows   !($.browser.msie  
 $.browser.version 
 7)) menuClasses.push(c.shadowClass);
                         $(this).addClass(menuClasses.join(' '));
                 });
         };

         var sf = $.fn.superfish;
         sf.o = [];
         sf.op = {};
         sf.IE7fix = function(){
                 var o = sf.op;
                 if ($.browser.msie  $.browser.version  6  o.dropShadows 
 
 o.animation.opacity!=undefined)
                         this.toggleClass(sf.c.shadowClass+'-off');
                 };
         sf.c = {
                 bcClass     : 'sf-breadcrumb',
                 menuClass   : 'sf-js-enabled',
                 anchorClass : 'sf-with-ul',
                 arrowClass  : 'sf-sub-indicator',
                 shadowClass : 'sf-shadow'
         };
         sf.defaults = {
                 hoverClass      : 'sfHover',
                 pathClass    

[jQuery] Re: Need help converting conventional code to jquery

2009-12-14 Thread Ibatex
Thats perfect, I think the eq(0) is what I was missing on my earlier
attempts

Much thanks, Leonardo!!

On Dec 14, 6:52 am, Leonardo K leo...@gmail.com wrote:
 function togglePassFail(radioName) {
     var buttonGrp = document.getElementsByName(radioName);
     var radioValue = $(buttonGrp).filter(':checked').val();
     var detailDiv = $(buttonGrp).eq(0).parent().next();
     if ( radioValue == 'p' ){
         detailDiv.hide();
     }else{
         detailDiv.show();
     }

 }
 On Sun, Dec 13, 2009 at 17:55, Ibatex mjgris...@gmail.com wrote:
  Hi all, I'm new here and new to jquery in general.

  Question is how can I do the following in jquery, I'd like to have
  access to jqueries effects and animations.

  function togglePassFail(radioName) {
         var buttonGrp = document.getElementsByName(radioName);
         var radioValue;

         // text input for related details are in a div thats the next
  sibling
  of the parent div of the radio buttons
         var detailDiv = buttonGrp[0].parentNode.nextSibling;

         // get value of selected radio button
         for (var i=0; ibuttonGrp.length; i++) {
                 if (buttonGrp[i].checked == true) {
                         radioValue = buttonGrp[i].value;
                 }
         }

         // hide if pass is selected, show otherwise
         detailDiv.style.display = (radioValue == 'p') ? 'none' : 'block';
  }

  Thanks ahead of time for any help.


Re: [jQuery] Re: Return values

2009-12-14 Thread Michael Geary
Looks like we have two threads going on the same topic. :-)

To give you a real code example, I'd need to see the code that makes use of
that 'result' variable you're setting. Where is that code and what does it
look like?

The bottom line is simple: whatever the code is that uses the 'result'
variable, that code needs to be made into a function, and you need to call
that function in the ajax success callback. Or, that function can *be* the
success callback.

You can't just set a variable in an asynchronous callback and expect other
code somewhere else on the page to somehow know when your variable is
ready for use.

It's not a question of how far deep in nested functions can you return a
value. Any nested function can return a value; it doesn't matter how far
deeply your functions are nested. But that return value goes only to
*whoever called that function*. In the case of a $.ajax callback, the return
value is being passed back into the $.ajax code, which probably ignores the
value completely.

The real issue is *when* the code is run.

Can you post a URL to a complete test page? That would make it a lot easier
to suggest the right way to write your code.

-Mike

On Mon, Dec 14, 2009 at 5:48 AM, Jojje jojjsus_chr...@hotmail.com wrote:

 Hi! Yeah i got that tip before but i'm not sure i understand this.
 Could you perhaps give me an example with the code below :)

 regards

 George

 On 14 Dec, 14:27, Rick van Hoeij rickvho...@gmail.com wrote:
  because of the async of javascript I normally use callback functions
  to do the value passing. So instead of return true or return false in
  a ajax function, it's better to call a function with the true or false
  as a parameter.
 
  Just my two cents ;)
 
  On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote:
 
   How deep in the scope can you go in nested functions and still return
   a value? For example:
 
   $.validator.addMethod('userCheck', function (value) {
   $.ajax({
   type: POST,
   url: _scripts/send_message.php,
   data: action=checkuser username= + value,
   success: function(msg) {
   if (msg) {
   return false;
   }
   else {
   return true;
   }
   }
   });
 
   },);
 
   Why is´nt this working?
 
   If i do this:
 
   //Global
   var result;
 
   $.validator.addMethod('userCheck', function (value) {
   $.ajax({
   type: POST,
   url: _scripts/send_message.php,
   data: action=checkuser username= + value,
   success: function(msg) {
   if (msg) {
   result = false;
   }
   else {
   result = true;
   }
   }
   });
   return result;
 
   },);
 
   i get the value back but it does not work properly, It gets the value
   from the textfield but on keyup it's always one letter short... so i
   have to type one more letter to get the right value. I´m stuck on this
   so any help would be greatly appreciated! :)
 
   Thanks in advance
 
   George



[jQuery]

2009-12-14 Thread Lord Gustavo Miguel Angel
unsuscribe 


[jQuery] Re: Return values

2009-12-14 Thread Jojje
Ok, yes you can check it out at 
http://www.sonicconnection.se/se/index.php?site=_misc/register

It´s in swedish but its the first field that uses the code to check if
the username already exists, it makes a call to a php script and the
response is equal to the username if it exists in the database, and if
it does'nt exist it returns nothing.

I put the parts of the script thats for the registration at the top
and commented it. the script file is sc_functions.js

Its a lot of repetetive code int there that i havent made into
fuctions yet so you know haha :)

Thanks again :)

George

On 14 Dec, 18:15, Michael Geary m...@mg.to wrote:
 Looks like we have two threads going on the same topic. :-)

 To give you a real code example, I'd need to see the code that makes use of
 that 'result' variable you're setting. Where is that code and what does it
 look like?

 The bottom line is simple: whatever the code is that uses the 'result'
 variable, that code needs to be made into a function, and you need to call
 that function in the ajax success callback. Or, that function can *be* the
 success callback.

 You can't just set a variable in an asynchronous callback and expect other
 code somewhere else on the page to somehow know when your variable is
 ready for use.

 It's not a question of how far deep in nested functions can you return a
 value. Any nested function can return a value; it doesn't matter how far
 deeply your functions are nested. But that return value goes only to
 *whoever called that function*. In the case of a $.ajax callback, the return
 value is being passed back into the $.ajax code, which probably ignores the
 value completely.

 The real issue is *when* the code is run.

 Can you post a URL to a complete test page? That would make it a lot easier
 to suggest the right way to write your code.

 -Mike

 On Mon, Dec 14, 2009 at 5:48 AM, Jojje jojjsus_chr...@hotmail.com wrote:
  Hi! Yeah i got that tip before but i'm not sure i understand this.
  Could you perhaps give me an example with the code below :)

  regards

  George

  On 14 Dec, 14:27, Rick van Hoeij rickvho...@gmail.com wrote:
   because of the async of javascript I normally use callback functions
   to do the value passing. So instead of return true or return false in
   a ajax function, it's better to call a function with the true or false
   as a parameter.

   Just my two cents ;)

   On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote:

How deep in the scope can you go in nested functions and still return
a value? For example:

$.validator.addMethod('userCheck', function (value) {
    $.ajax({
        type: POST,
        url: _scripts/send_message.php,
        data: action=checkuser username= + value,
        success: function(msg) {
            if (msg) {
                return false;
            }
            else {
                return true;
            }
        }
    });

},);

Why is´nt this working?

If i do this:

//Global
var result;

$.validator.addMethod('userCheck', function (value) {
    $.ajax({
        type: POST,
        url: _scripts/send_message.php,
        data: action=checkuser username= + value,
        success: function(msg) {
            if (msg) {
                result = false;
            }
            else {
                result = true;
            }
        }
    });
    return result;

},);

i get the value back but it does not work properly, It gets the value
from the textfield but on keyup it's always one letter short... so i
have to type one more letter to get the right value. I´m stuck on this
so any help would be greatly appreciated! :)

Thanks in advance

George


[jQuery] Re: Return values

2009-12-14 Thread Jojje
Oh and you type jojje to see how it behaves with an existing
username :)

On 14 Dec, 18:33, Jojje jojjsus_chr...@hotmail.com wrote:
 Ok, yes you can check it out 
 athttp://www.sonicconnection.se/se/index.php?site=_misc/register

 It´s in swedish but its the first field that uses the code to check if
 the username already exists, it makes a call to a php script and the
 response is equal to the username if it exists in the database, and if
 it does'nt exist it returns nothing.

 I put the parts of the script thats for the registration at the top
 and commented it. the script file is sc_functions.js

 Its a lot of repetetive code int there that i havent made into
 fuctions yet so you know haha :)

 Thanks again :)

 George

 On 14 Dec, 18:15, Michael Geary m...@mg.to wrote:

  Looks like we have two threads going on the same topic. :-)

  To give you a real code example, I'd need to see the code that makes use of
  that 'result' variable you're setting. Where is that code and what does it
  look like?

  The bottom line is simple: whatever the code is that uses the 'result'
  variable, that code needs to be made into a function, and you need to call
  that function in the ajax success callback. Or, that function can *be* the
  success callback.

  You can't just set a variable in an asynchronous callback and expect other
  code somewhere else on the page to somehow know when your variable is
  ready for use.

  It's not a question of how far deep in nested functions can you return a
  value. Any nested function can return a value; it doesn't matter how far
  deeply your functions are nested. But that return value goes only to
  *whoever called that function*. In the case of a $.ajax callback, the return
  value is being passed back into the $.ajax code, which probably ignores the
  value completely.

  The real issue is *when* the code is run.

  Can you post a URL to a complete test page? That would make it a lot easier
  to suggest the right way to write your code.

  -Mike

  On Mon, Dec 14, 2009 at 5:48 AM, Jojje jojjsus_chr...@hotmail.com wrote:
   Hi! Yeah i got that tip before but i'm not sure i understand this.
   Could you perhaps give me an example with the code below :)

   regards

   George

   On 14 Dec, 14:27, Rick van Hoeij rickvho...@gmail.com wrote:
because of the async of javascript I normally use callback functions
to do the value passing. So instead of return true or return false in
a ajax function, it's better to call a function with the true or false
as a parameter.

Just my two cents ;)

On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote:

 How deep in the scope can you go in nested functions and still return
 a value? For example:

 $.validator.addMethod('userCheck', function (value) {
     $.ajax({
         type: POST,
         url: _scripts/send_message.php,
         data: action=checkuser username= + value,
         success: function(msg) {
             if (msg) {
                 return false;
             }
             else {
                 return true;
             }
         }
     });

 },);

 Why is´nt this working?

 If i do this:

 //Global
 var result;

 $.validator.addMethod('userCheck', function (value) {
     $.ajax({
         type: POST,
         url: _scripts/send_message.php,
         data: action=checkuser username= + value,
         success: function(msg) {
             if (msg) {
                 result = false;
             }
             else {
                 result = true;
             }
         }
     });
     return result;

 },);

 i get the value back but it does not work properly, It gets the value
 from the textfield but on keyup it's always one letter short... so i
 have to type one more letter to get the right value. I´m stuck on this
 so any help would be greatly appreciated! :)

 Thanks in advance

 George


Re: [jQuery] how to get value between brackets in a string

2009-12-14 Thread tony stamp

thanks, but out of interest, how do i just get the number value?

Leonardo K wrote:
 
 $('#pageCount').text().replace(')','').replace('(','')
 
 On Mon, Dec 14, 2009 at 10:41, tony stamp tonyst...@hotmail.co.uk wrote:
 

 I have a simple span element with the id of pageCount, which has a value
 of
 (5), for example. I am attempting to get the just number value without
 the
 brackets, or some way of adjusting the number and leaving the brackets.
 Any
 pointers?
 --
 View this message in context:
 http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-tp26777141s27240p26777141.html
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.


 
 

-- 
View this message in context: 
http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-tp26777141s27240p26779941.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: how to get value between brackets in a string

2009-12-14 Thread MorningZ
like instead of saying .text() say something like .getnumber() ??

there is no built in way method to do so.. if there was a plugin
programmed to exist for that, it would be just like the line of code
Leonardo provided


On Dec 14, 1:03 pm, tony stamp tonyst...@hotmail.co.uk wrote:
 thanks, but out of interest, how do i just get the number value?



 Leonardo K wrote:

  $('#pageCount').text().replace(')','').replace('(','')

  On Mon, Dec 14, 2009 at 10:41, tony stamp tonyst...@hotmail.co.uk wrote:

  I have a simple span element with the id of pageCount, which has a value
  of
  (5), for example. I am attempting to get the just number value without
  the
  brackets, or some way of adjusting the number and leaving the brackets.
  Any
  pointers?
  --
  View this message in context:
 http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-t...
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.

 --
 View this message in 
 context:http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-t...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


Re: [jQuery] Re: Return values

2009-12-14 Thread Michael Geary
OK, so the real question here is a bit different from the question I've been
trying to answer. :-)

In general JavaScript coding, what I've been saying is true: If you want to
write code that uses data downloaded by a $.ajax call, you need to put that
code in a function called from the $.ajax success callback - or in the
callback itself.

However, what you're doing is using the validation plugin to validate a
form. So the question in this specific case is how do I get the validator
plugin to validate based on data downloaded via an ajax call, right?

The validator plugin has a specific interface built in for this. Instead of
calling $.ajax yourself and trying to somehow get the validation plugin to
use that data, you use the validation plugin's own 'remote' property, which
will make the $.ajax call for you.

Documentation and examples:

http://docs.jquery.com/Plugins/Validation/Methods/remote#options

Let me know if that helps!

-Mike

On Mon, Dec 14, 2009 at 9:33 AM, Jojje jojjsus_chr...@hotmail.com wrote:

 Ok, yes you can check it out at
 http://www.sonicconnection.se/se/index.php?site=_misc/register

 It´s in swedish but its the first field that uses the code to check if
 the username already exists, it makes a call to a php script and the
 response is equal to the username if it exists in the database, and if
 it does'nt exist it returns nothing.

 I put the parts of the script thats for the registration at the top
 and commented it. the script file is sc_functions.js

 Its a lot of repetetive code int there that i havent made into
 fuctions yet so you know haha :)

 Thanks again :)

 George

 On 14 Dec, 18:15, Michael Geary m...@mg.to wrote:
  Looks like we have two threads going on the same topic. :-)
 
  To give you a real code example, I'd need to see the code that makes use
 of
  that 'result' variable you're setting. Where is that code and what does
 it
  look like?
 
  The bottom line is simple: whatever the code is that uses the 'result'
  variable, that code needs to be made into a function, and you need to
 call
  that function in the ajax success callback. Or, that function can *be*
 the
  success callback.
 
  You can't just set a variable in an asynchronous callback and expect
 other
  code somewhere else on the page to somehow know when your variable is
  ready for use.
 
  It's not a question of how far deep in nested functions can you return a
  value. Any nested function can return a value; it doesn't matter how far
  deeply your functions are nested. But that return value goes only to
  *whoever called that function*. In the case of a $.ajax callback, the
 return
  value is being passed back into the $.ajax code, which probably ignores
 the
  value completely.
 
  The real issue is *when* the code is run.
 
  Can you post a URL to a complete test page? That would make it a lot
 easier
  to suggest the right way to write your code.
 
  -Mike
 
  On Mon, Dec 14, 2009 at 5:48 AM, Jojje jojjsus_chr...@hotmail.com
 wrote:
   Hi! Yeah i got that tip before but i'm not sure i understand this.
   Could you perhaps give me an example with the code below :)
 
   regards
 
   George
 
   On 14 Dec, 14:27, Rick van Hoeij rickvho...@gmail.com wrote:
because of the async of javascript I normally use callback functions
to do the value passing. So instead of return true or return false in
a ajax function, it's better to call a function with the true or
 false
as a parameter.
 
Just my two cents ;)
 
On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote:
 
 How deep in the scope can you go in nested functions and still
 return
 a value? For example:
 
 $.validator.addMethod('userCheck', function (value) {
 $.ajax({
 type: POST,
 url: _scripts/send_message.php,
 data: action=checkuser username= + value,
 success: function(msg) {
 if (msg) {
 return false;
 }
 else {
 return true;
 }
 }
 });
 
 },);
 
 Why is´nt this working?
 
 If i do this:
 
 //Global
 var result;
 
 $.validator.addMethod('userCheck', function (value) {
 $.ajax({
 type: POST,
 url: _scripts/send_message.php,
 data: action=checkuser username= + value,
 success: function(msg) {
 if (msg) {
 result = false;
 }
 else {
 result = true;
 }
 }
 });
 return result;
 
 },);
 
 i get the value back but it does not work properly, It gets the
 value
 from the textfield but on keyup it's always one letter short... so
 i
 have to type one more letter to get the right value. I´m stuck on
 this
 so any help would be greatly appreciated! :)
 
 Thanks in advance
 
 George



Re: [jQuery]

2009-12-14 Thread waseem sabjee
go to google groups homepage to unsubscribe.

On Mon, Dec 14, 2009 at 7:32 PM, Lord Gustavo Miguel Angel 
goosfanc...@gmail.com wrote:

 unsuscribe



[jQuery] Re: (Jquery Validate) Keep getting an error in IE8

2009-12-14 Thread snobo
I stumbled upon the same shit, and this is how IE8 reacts on OPTION
tags without value specified (like, optionblahblah/option). Until
jQuery is fixed to support it (and in my case I must stick to old
version 1.2.6, so fix is impossible) the workaround is to always use
option value=blahblahblahblah/option notation, if possible. Of
course it's not a generic solution, but might help someone.

On Nov 23, 4:55 pm, djseng dave.s...@gmail.com wrote:
 I'm getting this same error. Does anyone have a patch for it?

 On Nov 7, 9:31 pm, chobo2 howser_...@hotmail.com wrote:



  Hi

  I don't know what is going but my jqueryvalidateplugin(1.5.5) is not
  working and I am not sure for how long since I do most of my testing
  on firefox.

  The problem is this I go to one of my forms that jqueryvalidateon it
  and hit my create button my validation kicks in as it should and
  does this right in all browsers includingIE8. Now where it does not
  work is when I do this.

  I choose the first dropdown list and choose something. Then hit
  create now all validation errors should show up expect the one for
  the first dropdown box.

  It does this in all browsers except in IE 8. I get this

   Webpage error details

   User Agent: Mozilla/4.0 (compatible;
   MSIE 8.0; Windows NT 6.1; Win64; x64;
   Trident/4.0; .NET CLR 2.0.50727;
   SLCC2; .NET CLR 3.5.30729; .NET CLR
   3.0.30729; Media Center PC 6.0; Tablet PC 2.0) Timestamp: Sun, 8 Nov 2009
   03:26:08 UTC

   Message: Object required Line: 890
   Char: 5 Code: 0 URI:
  http://localhost:3668/Scripts/Plugins-Development/jquery.validate.js

  This is what is on line 890

      return options.length  0  ( element.type == select-multiple
  || ($.browser.msie  !(options[0].attributes['value'].specified) ?
  options[0].text : options[0].value).length  0);

  This like the whole method block.

          methods: {

                  //http://docs.jquery.com/Plugins/Validation/Methods/required
                  required: function(value, element, param) {
                          // check if dependency is met
                          if ( !this.depend(param, element) )
                                  return dependency-mismatch;
                          switch( element.nodeName.toLowerCase() ) {
                          case 'select':
                                  var options = $(option:selected, element);
                                  return options.length  0  ( element.type 
  == select-multiple
  || ($.browser.msie  !(options[0].attributes['value'].specified) ?
  options[0].text : options[0].value).length  0);
                          case 'input':
                                  if ( this.checkable(element) )
                                          return this.getLength(value, 
  element)  0;
                          default:
                                  return $.trim(value).length  0;
                          }
                  },

  Not sure what is going on.


[jQuery] Trying to select the first visible child in each group.

2009-12-14 Thread wandrian
Hey folks.

I am having a selector issue. Wondering if anyone might want to offer
their advice.

I have a set of container divs. For each of the containers I am trying
to select the *first visible child element* and add a class to it of
first. I have built out an example in jsbin. At the moment my selector
is finding the first child of each div and only adding a class of
first if that div is visible - which is wrong - seems to be doing
things backwards.

http://jsbin.com/opaze3/edit

Any advice would be greatly appreciated.

Cheers,
Matt


[jQuery] Re: Return values

2009-12-14 Thread Jojje
Oh i looked for a built in function for that but i must have missed it
haha, Thank you so much, worked like a charm and really easy to setup
to :) Thanks again :)

On 14 Dec, 19:11, Michael Geary m...@mg.to wrote:
 OK, so the real question here is a bit different from the question I've been
 trying to answer. :-)

 In general JavaScript coding, what I've been saying is true: If you want to
 write code that uses data downloaded by a $.ajax call, you need to put that
 code in a function called from the $.ajax success callback - or in the
 callback itself.

 However, what you're doing is using the validation plugin to validate a
 form. So the question in this specific case is how do I get the validator
 plugin to validate based on data downloaded via an ajax call, right?

 The validator plugin has a specific interface built in for this. Instead of
 calling $.ajax yourself and trying to somehow get the validation plugin to
 use that data, you use the validation plugin's own 'remote' property, which
 will make the $.ajax call for you.

 Documentation and examples:

 http://docs.jquery.com/Plugins/Validation/Methods/remote#options

 Let me know if that helps!

 -Mike

 On Mon, Dec 14, 2009 at 9:33 AM, Jojje jojjsus_chr...@hotmail.com wrote:
  Ok, yes you can check it out at
 http://www.sonicconnection.se/se/index.php?site=_misc/register

  It´s in swedish but its the first field that uses the code to check if
  the username already exists, it makes a call to a php script and the
  response is equal to the username if it exists in the database, and if
  it does'nt exist it returns nothing.

  I put the parts of the script thats for the registration at the top
  and commented it. the script file is sc_functions.js

  Its a lot of repetetive code int there that i havent made into
  fuctions yet so you know haha :)

  Thanks again :)

  George

  On 14 Dec, 18:15, Michael Geary m...@mg.to wrote:
   Looks like we have two threads going on the same topic. :-)

   To give you a real code example, I'd need to see the code that makes use
  of
   that 'result' variable you're setting. Where is that code and what does
  it
   look like?

   The bottom line is simple: whatever the code is that uses the 'result'
   variable, that code needs to be made into a function, and you need to
  call
   that function in the ajax success callback. Or, that function can *be*
  the
   success callback.

   You can't just set a variable in an asynchronous callback and expect
  other
   code somewhere else on the page to somehow know when your variable is
   ready for use.

   It's not a question of how far deep in nested functions can you return a
   value. Any nested function can return a value; it doesn't matter how far
   deeply your functions are nested. But that return value goes only to
   *whoever called that function*. In the case of a $.ajax callback, the
  return
   value is being passed back into the $.ajax code, which probably ignores
  the
   value completely.

   The real issue is *when* the code is run.

   Can you post a URL to a complete test page? That would make it a lot
  easier
   to suggest the right way to write your code.

   -Mike

   On Mon, Dec 14, 2009 at 5:48 AM, Jojje jojjsus_chr...@hotmail.com
  wrote:
Hi! Yeah i got that tip before but i'm not sure i understand this.
Could you perhaps give me an example with the code below :)

regards

George

On 14 Dec, 14:27, Rick van Hoeij rickvho...@gmail.com wrote:
 because of the async of javascript I normally use callback functions
 to do the value passing. So instead of return true or return false in
 a ajax function, it's better to call a function with the true or
  false
 as a parameter.

 Just my two cents ;)

 On 12 dec, 20:24, Jojje jojjsus_chr...@hotmail.com wrote:

  How deep in the scope can you go in nested functions and still
  return
  a value? For example:

  $.validator.addMethod('userCheck', function (value) {
      $.ajax({
          type: POST,
          url: _scripts/send_message.php,
          data: action=checkuser username= + value,
          success: function(msg) {
              if (msg) {
                  return false;
              }
              else {
                  return true;
              }
          }
      });

  },);

  Why is´nt this working?

  If i do this:

  //Global
  var result;

  $.validator.addMethod('userCheck', function (value) {
      $.ajax({
          type: POST,
          url: _scripts/send_message.php,
          data: action=checkuser username= + value,
          success: function(msg) {
              if (msg) {
                  result = false;
              }
              else {
                  result = true;
              }
          }
      });
      return result;

  },);

  i get the value back but it does not 

[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread wandrian
So this works:

$('.location').each(function(){
  $('div.trip:visible:first', this).addClass('first');
});

but it seems a little verbose. Is there a way of making it more
efficient?


[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread wandrian
You can see it in action at: http://jsbin.com/uzezi3/edit


[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread MorningZ
there *more than likely* is a quicker all in one selector to do this,
but this

http://jsbin.com/ijana/edit

works as you asked plus might be easier to follow  :-)

On Dec 14, 2:28 pm, wandrian mattba...@mac.com wrote:
 Hey folks.

 I am having a selector issue. Wondering if anyone might want to offer
 their advice.

 I have a set of container divs. For each of the containers I am trying
 to select the *first visible child element* and add a class to it of
 first. I have built out an example in jsbin. At the moment my selector
 is finding the first child of each div and only adding a class of
 first if that div is visible - which is wrong - seems to be doing
 things backwards.

 http://jsbin.com/opaze3/edit

 Any advice would be greatly appreciated.

 Cheers,
 Matt


[jQuery] Debugging in IE

2009-12-14 Thread Henjo
Hi list,

I am wondering how to do debugging in IE the best way. I installed
fiddler and work with ie8's dev tools.

The problem is I have a script that runs perfectly in FF, Chrome,
Safari but not in IE. There the dynamic form wizard. stops after 2
loads...

This is the site I am talking about http://bit.ly/7v8pHu

Thanks in advance for your tips.

Henjo


[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread MorningZ
oops.. too late with my reply... your selector and my find then
filter are doing the same thing.  the key point you figured out
is in each group, which means you had to start at div.location and
loop through those


Re: [jQuery] Trying to select the first visible child in each group.

2009-12-14 Thread Andrei Eftimie
See here http://jsbin.com/osepu/edit

On Mon, Dec 14, 2009 at 9:28 PM, wandrian mattba...@mac.com wrote:
 Hey folks.

 I am having a selector issue. Wondering if anyone might want to offer
 their advice.

 I have a set of container divs. For each of the containers I am trying
 to select the *first visible child element* and add a class to it of
 first. I have built out an example in jsbin. At the moment my selector
 is finding the first child of each div and only adding a class of
 first if that div is visible - which is wrong - seems to be doing
 things backwards.

 http://jsbin.com/opaze3/edit

 Any advice would be greatly appreciated.

 Cheers,
 Matt




-- 
Andrei Eftimie
http://eftimie.com
+40 758 833 281

Punct
http://designpunct.ro


RE: [jQuery] Debugging in IE

2009-12-14 Thread Scott Stewart
There is a Firebug Lite which runs in IE, it's not nearly as good as
Firebug, but it's better than nothing (or the developer tools in IE8

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Henjo
Sent: Monday, December 14, 2009 2:46 PM
To: jQuery (English)
Subject: [jQuery] Debugging in IE

Hi list,

I am wondering how to do debugging in IE the best way. I installed
fiddler and work with ie8's dev tools.

The problem is I have a script that runs perfectly in FF, Chrome,
Safari but not in IE. There the dynamic form wizard. stops after 2
loads...

This is the site I am talking about http://bit.ly/7v8pHu

Thanks in advance for your tips.

Henjo



[jQuery] .focus() and non-IE browsers.

2009-12-14 Thread T.J. Simmons
Hi all,

For some reason, it seems that the .focus() method (at least how I'm
using it) isn't properly setting the focus to what I'm specifying.
Here's the code I'm using.. maybe someone can help me with this.

$(.blNum).bind(blur, function(){
 if (a != b) {
  alert('Thing! Please fix.');
  $(this).focus();
 }
});

where a and b are my two controls, and the alert is an actual error
message. I'm trying to set the focus back to the text box (input
type=text class=blNum) if it doesn't match, and this only works
in IE.

Thanks,
T.J.


Re: [jQuery] Position()

2009-12-14 Thread Karl Swedberg



On Dec 10, 2009, at 12:39 PM, Paulodemoc wrote:


Hello guys,

i started another thread about the FullCalendar plugin, and I've
noticed what's happening.
The css 'top' and 'left' properties from the css aren't being
calculated properly...
The functions to calculate that uses the 'position()' function of
jquery, but it is always returning 0, 1 or -1, no matter where the
element is on the page...

Does anyone know if this is some jquery bug or something?


Might you be looking for .offset() instead?

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] Re: IE stops recurring ajax call

2009-12-14 Thread Scott Sauyet
On Dec 13, 1:52 pm, Henjo henjohoek...@gmail.com wrote:
 It works flawlessly in FF, Safari, Chrome... But IE is being nasty on
 me!

Being nasty is probably quite accurate, but not specific enough for
us to offer help!

What's happening.  Better yet, is there a way you can post a live URL?

  -- Scott


[jQuery] Re: Debugging in IE

2009-12-14 Thread Henjo
Hey Scott,

thanks for posting. I will check this out and see if I can find
something here...

Henjo

On Dec 14, 8:51 pm, Scott Stewart sstwebwo...@bellsouth.net wrote:
 There is a Firebug Lite which runs in IE, it's not nearly as good as
 Firebug, but it's better than nothing (or the developer tools in IE8



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

 Behalf Of Henjo
 Sent: Monday, December 14, 2009 2:46 PM
 To: jQuery (English)
 Subject: [jQuery] Debugging in IE

 Hi list,

 I am wondering how to do debugging in IE the best way. I installed
 fiddler and work with ie8's dev tools.

 The problem is I have a script that runs perfectly in FF, Chrome,
 Safari but not in IE. There the dynamic form wizard. stops after 2
 loads...

 This is the site I am talking abouthttp://bit.ly/7v8pHu

 Thanks in advance for your tips.

 Henjo


[jQuery] Re: IE stops recurring ajax call

2009-12-14 Thread Henjo
Hi Scott,

first of all thanks for your help, I appreciate that!

Here's the link to the website, it is the product wizard form:
http://bit.ly/7v8pHu

Henjo

On Dec 14, 9:30 pm, Scott Sauyet scott.sau...@gmail.com wrote:
 On Dec 13, 1:52 pm, Henjo henjohoek...@gmail.com wrote:

  It works flawlessly in FF, Safari, Chrome... But IE is being nasty on
  me!

 Being nasty is probably quite accurate, but not specific enough for
 us to offer help!

 What's happening.  Better yet, is there a way you can post a live URL?

   -- Scott


[jQuery] validate (help with plugin)

2009-12-14 Thread Scott Phillips
I am trying to get the validate plugin (http://docs.jquery.com/Plugins/
Validation) to work with my forms, but all I seem to be able to
produce is errors My code looks like this (I've commented out
where I was trying to add it):

$(function () {

//$(#loginForm).validate({
$(#loginForm).submit(function(){
dataString = $(#loginForm).serialize();
$(.statusMessage).html('Working...').addClass('ui-state-
highlight').fadeTo(fast,1);
$.ajax({
type: POST,
url: /usr/ajaxlogin.php,
data: dataString,
dataType: json,
success: function(data,textStatus) {
if(data.status == stop){
$(.statusMessage).html(Sorry:  +
data.message).addClass('ui-state-error').fadeTo(fast,1);
}

if(data.status == go){
$(.statusMessage).html(div
class='errorMessage'  + data.message).addClass('ui-state-
error').fadeTo(fast,1);
window.location.href=data.url;
}

},
timeout:3000,
error: function (XMLHttpRequest, textStatus, errorThrown)
{
$(.statusMessage).html('We have encountered an
error, please notify support or try again.').addClass('ui-state-
error').fadeTo(fast,1);
}
}); // end .ajax

return false;

}); // end form submit func.

//});

}); // End Ready Func.


[jQuery] Looking for image slider like this for jQuery

2009-12-14 Thread vs
I am trying to find a jQuery (or even any javascript) equivalent for
this kind of slideshow: 
http://www.flashcomponents.net/upload/samples/2860/index.html?full=true

Any suggestions?


[jQuery] additional methods: minDate

2009-12-14 Thread dnagirl
In case anyone is using the .datepicker plugin along with .validate,
here is a useful rule for dependant dates.

`
jQuery.validator.addMethod(minDate, function(value, element, param)
{
try {
var 
afterdate=$.datepicker.parseDate($(element).datepicker
('option','dateFormat'),value);
var 
beforedate=$.datepicker.parseDate($(param).datepicker
('option','dateFormat'),$(param).val());
return this.optional(element) || afterdate = 
beforedate;
} catch(err){
return false;
}
}, function(param){
return Date must occur on or after + $(param).val();
}
);
`

Used as:
`
rules: {
ev_start: { required: true},
ev_end:{ required: true,
 minDate: :input[name='ev_start']
}
`


[jQuery] Problem with show function and onmouseout

2009-12-14 Thread JacobDK
Hey all
Im pretty new to JQuery, but got some things working, but now I came
across somthing I cant get to work, even after Googling for some time.
In an XSL file I have set an onmouseover event to a function which
sets different things on a div, and then displays it accordingly to
where the element with the onmouseover is located.
I am using JQuery function show(fast) to get a nice animation on the
div when its shown.

On the onmouseout I hide the div with plain style access with
Javascript style.display = ''
This is all used for thumbnail showing on a list of elements, but when
I stress the system by fast moving over the elements and then suddenly
moving the mousecursor away from the list, it possible to get the div
to stay shown.

I dont really understand why, cause since onmouseout is set på
style.display='' to my best knowledge the div should allways be
hidden.
Is there some kind of delay before show sets the display different
from blank, or could someone point me to what im doing wrong.


[jQuery] Can't get a block of HTML added to the DOM

2009-12-14 Thread joseph7
Hi,

So, I'm attempting to add HTML to a document via Ajax, but when I get
back the content, I'm finding that no matter what I try, I can't get
it added to the DOM correctly. Basically I'm doing this:

$.post('ajax.php',
 function (data) {
  var html = data.content;
  $('#somediv').append(html);
 }
);

The HTML I'm loading looks like this:

div class=somediv
form id=someform
p class=someclassName:/p
input style=display: none; type=textbox 
name=somefield
value=test /
/p
/form
/div

While the content does show up in the div, if I try to get the form by
doing $('#someform'), jQuery returns nothing. I've tried using .append
() and .html(), and neither way gives me what I want. Is there
something I'm missing here? I know adding objects to the DOM in jQuery
is ridiculously easy, so I feel like I'm either running up against
something impossible, or I have a hugely flawed concept of how append
() and html() work.


[jQuery] Extending JQuery auto complete code

2009-12-14 Thread AndrewM
Hi,

Your jQuery examples really good thanks.

However I have a couple of questions:

1.  Can you advise which part of the code I need to extend so that the
auto complete code does not call on the first page load.  The field I
am using it for needs some information text to appear when the page
first loads however the auto complete code is clearing this initial
prompt code.

2. My auto complete items are in the format of Town, Area however I
need the auto complete to ignore the comma(,).  Currently to filter
the auto complete list to show for example MyTown, MyArea I have to
type MyTown, M.  I want to instead type MyTown M.

Can you please give guidance for the sections of either jQuery or
jquery.autocomplete that I need to ammend.

Thanks for your help regards

Andrew


[jQuery] Re: Can't get a block of HTML added to the DOM

2009-12-14 Thread T.J. Simmons
Have you tried it without the data.content?

IE: var html = data;

that should get you all of the HTML you're pulling in via AJAX. I
haven't ever seen the .content method before, and a quick Google
search came up with nothing for it.. maybe that's the problem? I'm
sure someone who knows more will come in and blast my answer, but
that's my thought.

Hope that helps.

- T.J.

On Dec 14, 10:05 am, joseph7 radioak...@gmail.com wrote:
 Hi,

 So, I'm attempting to add HTML to a document via Ajax, but when I get
 back the content, I'm finding that no matter what I try, I can't get
 it added to the DOM correctly. Basically I'm doing this:

 $.post('ajax.php',
      function (data) {
           var html = data.content;
           $('#somediv').append(html);
      }
 );

 The HTML I'm loading looks like this:

 div class=somediv
         form id=someform
                 p class=someclassName:/p
                         input style=display: none; type=textbox 
 name=somefield
 value=test /
                 /p
         /form
 /div

 While the content does show up in the div, if I try to get the form by
 doing $('#someform'), jQuery returns nothing. I've tried using .append
 () and .html(), and neither way gives me what I want. Is there
 something I'm missing here? I know adding objects to the DOM in jQuery
 is ridiculously easy, so I feel like I'm either running up against
 something impossible, or I have a hugely flawed concept of how append
 () and html() work.


Re: [jQuery] Validation Plugin:need help with errorPlacement

2009-12-14 Thread Gian-ava

Leonardo,

I see. Firebug' error console says:

Error: missing ) after argument list
Line: 8, Column: 12
Source Code:
}

Strange, since I don't think this  is correct.

Also, it says:
Error: syntax error
Line: 7, Column: 30
Source Code:
  errorPlacement: function(error, element) { 

Again, I don't see any error there.

Anyway, if I write this, the error label gets printed after the .roxElem,
but for each required field I get as many error labels as I defined (ex: I
got 4 required fields, so for rowElem I get the 4 messages):

$$(document).ready(function(){
$('#actionform').validate({

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

submitHandler: function(form) {
 
$(form).ajaxSubmit({
   
success: function() {
$('#actionform').hide();
$('#content').append(p class='thanks'Thanks! Your
request has been sent./p)
}
   });
 }
 
});
});

I can't believe it is so difficult to control where to display the error
message. The problem is that since I use jqtransform plugin, the latter
prints and wraps all fields into a lot of stuff fot styling elements, and
when the validation plugin prints the error label after the input field, it
actually display IN the field. I want it out of the field, so I need it to
be printed after the .rowElem.

Where's the plugin author?
-- 
View this message in context: 
http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26780208.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: IE stops recurring ajax call

2009-12-14 Thread Henjo
The form is loaded on pageload. After that it is possible to make 1
call to the script again. After that it somehow renders no result in
IE.
I do not know how to get more details on what is missing and why -
which drives me crazy 'cause it means I do not know how to fix it...

I am quite lost here - unfortunately...

:-(

Thanks for sharing your insights on this.

Henjo

On Dec 14, 10:33 pm, Henjo henjohoek...@gmail.com wrote:
 Hi Scott,

 first of all thanks for your help, I appreciate that!

 Here's the link to the website, it is the product wizard 
 form:http://bit.ly/7v8pHu

 Henjo

 On Dec 14, 9:30 pm, Scott Sauyet scott.sau...@gmail.com wrote:



  On Dec 13, 1:52 pm, Henjo henjohoek...@gmail.com wrote:

   It works flawlessly in FF, Safari, Chrome... But IE is being nasty on
   me!

  Being nasty is probably quite accurate, but not specific enough for
  us to offer help!

  What's happening.  Better yet, is there a way you can post a live URL?

    -- Scott


Re: [jQuery] Re: Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
T.J., I think you're right on the money.

Joseph, no need to wonder whether you've run into an issue with the
.append() method. Instead, verify whether you actually have the right data
on hand or not.

Where you had this code:

$('#somediv').append(html);

Change it to:

alert( html );

and see what the alert shows.

It may well say something like undefined. If you try T.J.'s suggestion,
you may find something more useful. Either way, by alerting the value (or
using console.log with Firebug or the like), you can check that the HTML
code you're trying to append is actually what you want.

-Mike

On Mon, Dec 14, 2009 at 2:03 PM, T.J. Simmons theimmortal...@gmail.comwrote:

 Have you tried it without the data.content?

 IE: var html = data;

 that should get you all of the HTML you're pulling in via AJAX. I
 haven't ever seen the .content method before, and a quick Google
 search came up with nothing for it.. maybe that's the problem? I'm
 sure someone who knows more will come in and blast my answer, but
 that's my thought.

 Hope that helps.

 - T.J.

 On Dec 14, 10:05 am, joseph7 radioak...@gmail.com wrote:
  Hi,
 
  So, I'm attempting to add HTML to a document via Ajax, but when I get
  back the content, I'm finding that no matter what I try, I can't get
  it added to the DOM correctly. Basically I'm doing this:
 
  $.post('ajax.php',
   function (data) {
var html = data.content;
$('#somediv').append(html);
   }
  );
 
  The HTML I'm loading looks like this:
 
  div class=somediv
  form id=someform
  p class=someclassName:/p
  input style=display: none; type=textbox
 name=somefield
  value=test /
  /p
  /form
  /div
 
  While the content does show up in the div, if I try to get the form by
  doing $('#someform'), jQuery returns nothing. I've tried using .append
  () and .html(), and neither way gives me what I want. Is there
  something I'm missing here? I know adding objects to the DOM in jQuery
  is ridiculously easy, so I feel like I'm either running up against
  something impossible, or I have a hugely flawed concept of how append
  () and html() work.



Re: [jQuery] Re: Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
Oh, wait a minute. You said the content *does* show up in the div.

I think you need to post a link to a test page, so we can see what is
actually happening. That would make it a lot easier to help troubleshoot.

-Mike

On Mon, Dec 14, 2009 at 2:15 PM, Michael Geary m...@mg.to wrote:

 T.J., I think you're right on the money.

 Joseph, no need to wonder whether you've run into an issue with the
 .append() method. Instead, verify whether you actually have the right data
 on hand or not.

 Where you had this code:

 $('#somediv').append(html);

 Change it to:

 alert( html );

 and see what the alert shows.

 It may well say something like undefined. If you try T.J.'s suggestion,
 you may find something more useful. Either way, by alerting the value (or
 using console.log with Firebug or the like), you can check that the HTML
 code you're trying to append is actually what you want.

 -Mike


 On Mon, Dec 14, 2009 at 2:03 PM, T.J. Simmons theimmortal...@gmail.comwrote:

 Have you tried it without the data.content?

 IE: var html = data;

 that should get you all of the HTML you're pulling in via AJAX. I
 haven't ever seen the .content method before, and a quick Google
 search came up with nothing for it.. maybe that's the problem? I'm
 sure someone who knows more will come in and blast my answer, but
 that's my thought.

 Hope that helps.

 - T.J.

 On Dec 14, 10:05 am, joseph7 radioak...@gmail.com wrote:
  Hi,
 
  So, I'm attempting to add HTML to a document via Ajax, but when I get
  back the content, I'm finding that no matter what I try, I can't get
  it added to the DOM correctly. Basically I'm doing this:
 
  $.post('ajax.php',
   function (data) {
var html = data.content;
$('#somediv').append(html);
   }
  );
 
  The HTML I'm loading looks like this:
 
  div class=somediv
  form id=someform
  p class=someclassName:/p
  input style=display: none; type=textbox
 name=somefield
  value=test /
  /p
  /form
  /div
 
  While the content does show up in the div, if I try to get the form by
  doing $('#someform'), jQuery returns nothing. I've tried using .append
  () and .html(), and neither way gives me what I want. Is there
  something I'm missing here? I know adding objects to the DOM in jQuery
  is ridiculously easy, so I feel like I'm either running up against
  something impossible, or I have a hugely flawed concept of how append
  () and html() work.





[jQuery] Re: Debugging in IE

2009-12-14 Thread MorningZ
I would *definitely* start by using the non-minified version of
jQuery, as it's 1000x easier to get an idea of what's going on  (i see
in the source of the page you are using the min-ed version)


On Dec 14, 4:31 pm, Henjo henjohoek...@gmail.com wrote:
 Hey Scott,

 thanks for posting. I will check this out and see if I can find
 something here...

 Henjo

 On Dec 14, 8:51 pm, Scott Stewart sstwebwo...@bellsouth.net wrote:

  There is a Firebug Lite which runs in IE, it's not nearly as good as
  Firebug, but it's better than nothing (or the developer tools in IE8

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

  Behalf Of Henjo
  Sent: Monday, December 14, 2009 2:46 PM
  To: jQuery (English)
  Subject: [jQuery] Debugging in IE

  Hi list,

  I am wondering how to do debugging in IE the best way. I installed
  fiddler and work with ie8's dev tools.

  The problem is I have a script that runs perfectly in FF, Chrome,
  Safari but not in IE. There the dynamic form wizard. stops after 2
  loads...

  This is the site I am talking abouthttp://bit.ly/7v8pHu

  Thanks in advance for your tips.

  Henjo


[jQuery] Re: Can't get a block of HTML added to the DOM

2009-12-14 Thread T.J. Simmons
That's the part that had me a little confused, that it's showing up at
all; as far as I can tell, the way .append() is used is correct. A
page, like Mike said, that shows what you're using and the context in
which you're using it would definitely go a long way towards figuring
this out.

- T.J.

On Dec 14, 4:17 pm, Michael Geary m...@mg.to wrote:
 Oh, wait a minute. You said the content *does* show up in the div.

 I think you need to post a link to a test page, so we can see what is
 actually happening. That would make it a lot easier to help troubleshoot.

 -Mike



 On Mon, Dec 14, 2009 at 2:15 PM, Michael Geary m...@mg.to wrote:
  T.J., I think you're right on the money.

  Joseph, no need to wonder whether you've run into an issue with the
  .append() method. Instead, verify whether you actually have the right data
  on hand or not.

  Where you had this code:

  $('#somediv').append(html);

  Change it to:

  alert( html );

  and see what the alert shows.

  It may well say something like undefined. If you try T.J.'s suggestion,
  you may find something more useful. Either way, by alerting the value (or
  using console.log with Firebug or the like), you can check that the HTML
  code you're trying to append is actually what you want.

  -Mike

  On Mon, Dec 14, 2009 at 2:03 PM, T.J. Simmons 
  theimmortal...@gmail.comwrote:

  Have you tried it without the data.content?

  IE: var html = data;

  that should get you all of the HTML you're pulling in via AJAX. I
  haven't ever seen the .content method before, and a quick Google
  search came up with nothing for it.. maybe that's the problem? I'm
  sure someone who knows more will come in and blast my answer, but
  that's my thought.

  Hope that helps.

  - T.J.

  On Dec 14, 10:05 am, joseph7 radioak...@gmail.com wrote:
   Hi,

   So, I'm attempting to add HTML to a document via Ajax, but when I get
   back the content, I'm finding that no matter what I try, I can't get
   it added to the DOM correctly. Basically I'm doing this:

   $.post('ajax.php',
        function (data) {
             var html = data.content;
             $('#somediv').append(html);
        }
   );

   The HTML I'm loading looks like this:

   div class=somediv
           form id=someform
                   p class=someclassName:/p
                           input style=display: none; type=textbox
  name=somefield
   value=test /
                   /p
           /form
   /div

   While the content does show up in the div, if I try to get the form by
   doing $('#someform'), jQuery returns nothing. I've tried using .append
   () and .html(), and neither way gives me what I want. Is there
   something I'm missing here? I know adding objects to the DOM in jQuery
   is ridiculously easy, so I feel like I'm either running up against
   something impossible, or I have a hugely flawed concept of how append
   () and html() work.


[jQuery] Re: IE stops recurring ajax call

2009-12-14 Thread Scott Sauyet
On Dec 14, 4:33 pm, Henjo henjohoek...@gmail.com wrote:
 Here's the link to the website, it is the product wizard 
 form:http://bit.ly/7v8pHu

Okay, if you haven't used Fiddler [1], it's pretty useful for testing
HTTP request on IE, something like LiveHTTPHeaders for Firefox, and
more general.

The first thing I found is that IE isn't even submitting the second
request.  It's a little hard to try to build my own version of this to
determine why, but you might want to either use Firebug Lite [2] as
someone suggested in another thread or simply add some alerts to see
how far it gets.  You should be able to quickly nail down whether it
gets to the jQuery ajax call at all.  If it does, you probably can
supply more information for this list.  If not, hopefully the line it
stops on can supply you with help.

But I'm going to suggest that you rethink the code design altogether.
Rather than returning the whole set of select elements as HTML, I
would suggest that you return some JSON, either the data for all three
select boxes or the data for each successive one.

Then I think you could write a function named, say, linkedDropdowns,
which you would use like this:

linkedDropdowns(option1, option2, function() {
return {option1: $(#option1 select).val()};
});
linkedDropdowns(option2, option3, function() {
return {option2: $(#option2 select).val()};
});

This function would bind the change event on the element named by the
first argument to a function that merged the results of calling the
third argument with your common data ({L: TYP03_LANG}) and then
perform an ajax call using that merged data.  The success function of
that ajax call would update the element named by the second argument
using the JSON data supplied, and perform the scrolling or hiding
necessary for your UI.  It would probably delegate the updating to
another function which you could also use to populate the initial
list.

This would make it easier to add additional steps as needed, or to
return something additional in the JSON that says there are no
additional steps.  The deeply nested code you've got is likely to be
difficult to maintain.

I don't have time to try to code something like this myself now, but
the main code might look something like this:

var defaults = {L: TYP03_LANG};

function updateSelect(select, data) {
// loop through the results in data creating the inner HTML
for the select box
$(# + select).html(myHTML);
// hide all the select boxes (perhaps with visibility and size
rather than hide), then reset the current one to visible
}

function linkedDropdown(select1, select2, fn) {
$(# + select1).change(function() {
$.get(index.php?eID=tx_knowledgebase_pi1, $.extend
(defaults,fn()), function(data, textStatus) {
// if good text status
updateSelect(select2, data);
}, json)
});
}

$.get(index.php?eID=tx_knowledgebase_pi1, defaults, function
(data, textStatus) {
updateSelect(option1, data);
});

linkedDropdowns(option1, option2, function() {
return {option1: $(#option1 select).val()};
});
linkedDropdowns(option2, option3, function() {
return {option2: $(#option2 select).val()};
});

Of course this is probably full of typos, and maybe it wouldn't work
at all for your case, but I think it would be easier to write
something reusable like this and then use if a few times in your code
than to do this deeply nested, and very fragile-looking code.

Good luck,

  -- Scott

[1] http://www.fiddler2.com/fiddler2/
[2] http://getfirebug.com/lite.html


[jQuery] Re: detecting edge cases when swapping divs

2009-12-14 Thread Abbey
@Robert The code didn't work for me.

@Charlie I tried length=0 and length=1 and the pane always goes past
the footer div.

$(.pane .arrowdown).click(function() {
if($(this).next().length==1) { // charlie: will return true if at
bottom, would have to test after the animation, or use length==1 if
test before animation
$(this).css(visibility,hidden);
return;
} else {

$(this).parents(.pane).slideUp(slow,function(){
$(this).insertAfter($(this).next()).slideDown(slow);
});
return false;
}

});


[jQuery] Re: IE stops recurring ajax call

2009-12-14 Thread Henjo
Hi Scott,

thanks very much for your elaborate writing. This should give me
enough to work on it and get it done.
I am rather new to jQuery and ajax altogether - so that my code
wouldn't get a 10 I understand ;-)

Thanks for your evaluation on this.

I did install Fiddler  Firebug Lite and got some info from that - but
by far not enough to understand what goes wrong.

I will rework on this and at least post back when it works.

Thanks again.

Henjo

On Dec 14, 11:41 pm, Scott Sauyet scott.sau...@gmail.com wrote:
 On Dec 14, 4:33 pm, Henjo henjohoek...@gmail.com wrote:

  Here's the link to the website, it is the product wizard 
  form:http://bit.ly/7v8pHu

 Okay, if you haven't used Fiddler [1], it's pretty useful for testing
 HTTP request on IE, something like LiveHTTPHeaders for Firefox, and
 more general.

 The first thing I found is that IE isn't even submitting the second
 request.  It's a little hard to try to build my own version of this to
 determine why, but you might want to either use Firebug Lite [2] as
 someone suggested in another thread or simply add some alerts to see
 how far it gets.  You should be able to quickly nail down whether it
 gets to the jQuery ajax call at all.  If it does, you probably can
 supply more information for this list.  If not, hopefully the line it
 stops on can supply you with help.

 But I'm going to suggest that you rethink the code design altogether.
 Rather than returning the whole set of select elements as HTML, I
 would suggest that you return some JSON, either the data for all three
 select boxes or the data for each successive one.

 Then I think you could write a function named, say, linkedDropdowns,
 which you would use like this:

     linkedDropdowns(option1, option2, function() {
         return {option1: $(#option1 select).val()};
     });
     linkedDropdowns(option2, option3, function() {
         return {option2: $(#option2 select).val()};
     });

 This function would bind the change event on the element named by the
 first argument to a function that merged the results of calling the
 third argument with your common data ({L: TYP03_LANG}) and then
 perform an ajax call using that merged data.  The success function of
 that ajax call would update the element named by the second argument
 using the JSON data supplied, and perform the scrolling or hiding
 necessary for your UI.  It would probably delegate the updating to
 another function which you could also use to populate the initial
 list.

 This would make it easier to add additional steps as needed, or to
 return something additional in the JSON that says there are no
 additional steps.  The deeply nested code you've got is likely to be
 difficult to maintain.

 I don't have time to try to code something like this myself now, but
 the main code might look something like this:

     var defaults = {L: TYP03_LANG};

     function updateSelect(select, data) {
         // loop through the results in data creating the inner HTML
 for the select box
         $(# + select).html(myHTML);
         // hide all the select boxes (perhaps with visibility and size
 rather than hide), then reset the current one to visible
     }

     function linkedDropdown(select1, select2, fn) {
         $(# + select1).change(function() {
             $.get(index.php?eID=tx_knowledgebase_pi1, $.extend
 (defaults,fn()), function(data, textStatus) {
                 // if good text status
                 updateSelect(select2, data);
             }, json)
         });
     }

     $.get(index.php?eID=tx_knowledgebase_pi1, defaults, function
 (data, textStatus) {
         updateSelect(option1, data);
     });

     linkedDropdowns(option1, option2, function() {
         return {option1: $(#option1 select).val()};
     });
     linkedDropdowns(option2, option3, function() {
         return {option2: $(#option2 select).val()};
     });

 Of course this is probably full of typos, and maybe it wouldn't work
 at all for your case, but I think it would be easier to write
 something reusable like this and then use if a few times in your code
 than to do this deeply nested, and very fragile-looking code.

 Good luck,

   -- Scott

 [1]http://www.fiddler2.com/fiddler2/
 [2]http://getfirebug.com/lite.html


[jQuery] Re: IE stops recurring ajax call

2009-12-14 Thread MorningZ
Since you have two topics going on the same exact topic, i'll repeat
what i suggested in topic # 2:

Stop using the minified version for debugging purposes  if your
code doesn't work, you should be using the full version of jQuery,
as the minified version adds a LOT of complexity when trying to figure
out what (bad) is going on



On Dec 14, 6:03 pm, Henjo henjohoek...@gmail.com wrote:
 Hi Scott,

 thanks very much for your elaborate writing. This should give me
 enough to work on it and get it done.
 I am rather new to jQuery and ajax altogether - so that my code
 wouldn't get a 10 I understand ;-)

 Thanks for your evaluation on this.

 I did install Fiddler  Firebug Lite and got some info from that - but
 by far not enough to understand what goes wrong.

 I will rework on this and at least post back when it works.

 Thanks again.

 Henjo

 On Dec 14, 11:41 pm, Scott Sauyet scott.sau...@gmail.com wrote:

  On Dec 14, 4:33 pm, Henjo henjohoek...@gmail.com wrote:

   Here's the link to the website, it is the product wizard 
   form:http://bit.ly/7v8pHu

  Okay, if you haven't used Fiddler [1], it's pretty useful for testing
  HTTP request on IE, something like LiveHTTPHeaders for Firefox, and
  more general.

  The first thing I found is that IE isn't even submitting the second
  request.  It's a little hard to try to build my own version of this to
  determine why, but you might want to either use Firebug Lite [2] as
  someone suggested in another thread or simply add some alerts to see
  how far it gets.  You should be able to quickly nail down whether it
  gets to the jQuery ajax call at all.  If it does, you probably can
  supply more information for this list.  If not, hopefully the line it
  stops on can supply you with help.

  But I'm going to suggest that you rethink the code design altogether.
  Rather than returning the whole set of select elements as HTML, I
  would suggest that you return some JSON, either the data for all three
  select boxes or the data for each successive one.

  Then I think you could write a function named, say, linkedDropdowns,
  which you would use like this:

      linkedDropdowns(option1, option2, function() {
          return {option1: $(#option1 select).val()};
      });
      linkedDropdowns(option2, option3, function() {
          return {option2: $(#option2 select).val()};
      });

  This function would bind the change event on the element named by the
  first argument to a function that merged the results of calling the
  third argument with your common data ({L: TYP03_LANG}) and then
  perform an ajax call using that merged data.  The success function of
  that ajax call would update the element named by the second argument
  using the JSON data supplied, and perform the scrolling or hiding
  necessary for your UI.  It would probably delegate the updating to
  another function which you could also use to populate the initial
  list.

  This would make it easier to add additional steps as needed, or to
  return something additional in the JSON that says there are no
  additional steps.  The deeply nested code you've got is likely to be
  difficult to maintain.

  I don't have time to try to code something like this myself now, but
  the main code might look something like this:

      var defaults = {L: TYP03_LANG};

      function updateSelect(select, data) {
          // loop through the results in data creating the inner HTML
  for the select box
          $(# + select).html(myHTML);
          // hide all the select boxes (perhaps with visibility and size
  rather than hide), then reset the current one to visible
      }

      function linkedDropdown(select1, select2, fn) {
          $(# + select1).change(function() {
              $.get(index.php?eID=tx_knowledgebase_pi1, $.extend
  (defaults,fn()), function(data, textStatus) {
                  // if good text status
                  updateSelect(select2, data);
              }, json)
          });
      }

      $.get(index.php?eID=tx_knowledgebase_pi1, defaults, function
  (data, textStatus) {
          updateSelect(option1, data);
      });

      linkedDropdowns(option1, option2, function() {
          return {option1: $(#option1 select).val()};
      });
      linkedDropdowns(option2, option3, function() {
          return {option2: $(#option2 select).val()};
      });

  Of course this is probably full of typos, and maybe it wouldn't work
  at all for your case, but I think it would be easier to write
  something reusable like this and then use if a few times in your code
  than to do this deeply nested, and very fragile-looking code.

  Good luck,

    -- Scott

  [1]http://www.fiddler2.com/fiddler2/
  [2]http://getfirebug.com/lite.html


[jQuery] alter document ready

2009-12-14 Thread Wendi Turner
I have a asp.net #c SlideShowControl in a default.aspx page.  The
SlideShowControl uses jQuery to set the xml file of image urls that
the control displays with a $(document).ready( ...) function.  How can
I re-wrte this on client callback so that the xml image file
referenced can change on the client.  I know how to trigger the client
call back to the server, what I don't know how to do is to purge the
previously constructed $(document).ready to be re-written.




Re: [jQuery] Can't get a block of HTML added to the DOM

2009-12-14 Thread brian
$('#somediv').append(html);

You're appending to the div with ID 'someDiv'. But you say that this
is the content:

div class=somediv
   form id=someform
   p class=someclassName:/p
   input style=display: none; type=textbox
name=somefield
value=test /
   /p
   /form
/div

Note the class=somediv. I'm wondering if that's a typo and it's
actually id=somediv, in which case you'll have 2 divs with identical
IDs.

Just a shot in the dark.

On Mon, Dec 14, 2009 at 11:05 AM, joseph7 radioak...@gmail.com wrote:
 Hi,

 So, I'm attempting to add HTML to a document via Ajax, but when I get
 back the content, I'm finding that no matter what I try, I can't get
 it added to the DOM correctly. Basically I'm doing this:

 $.post('ajax.php',
     function (data) {
          var html = data.content;
          $('#somediv').append(html);
     }
 );

 The HTML I'm loading looks like this:

 div class=somediv
        form id=someform
                p class=someclassName:/p
                        input style=display: none; type=textbox 
 name=somefield
 value=test /
                /p
        /form
 /div

 While the content does show up in the div, if I try to get the form by
 doing $('#someform'), jQuery returns nothing. I've tried using .append
 () and .html(), and neither way gives me what I want. Is there
 something I'm missing here? I know adding objects to the DOM in jQuery
 is ridiculously easy, so I feel like I'm either running up against
 something impossible, or I have a hugely flawed concept of how append
 () and html() work.



Re: [jQuery] Can't get a block of HTML added to the DOM

2009-12-14 Thread Wendi Turner
 *How can you remove/delete the active $(document).ready() script, re-write
and re-register then re-trigger the ready script??  Without reloading the
page?*


[jQuery] Re: detecting edge cases when swapping divs

2009-12-14 Thread robert...@gmail.com
Abbey - Here you go - this works for me in IE

http://www.greenearthcrew.com/jquery/moverows.htm



On Dec 14, 5:43 pm, Abbey i.am.wait...@gmail.com wrote:
 @Robert The code didn't work for me.

 @Charlie I tried length=0 and length=1 and the pane always goes past
 the footer div.

 $(.pane .arrowdown).click(function() {
     if($(this).next().length==1) { // charlie: will return true if at
 bottom, would have to test after the animation, or use length==1 if
 test before animation
                 $(this).css(visibility,hidden);
                 return;
         } else {

     $(this).parents(.pane).slideUp(slow,function(){
                         $(this).insertAfter($(this).next()).slideDown(slow);
         });
     return false;
         }



 });- Hide quoted text -

 - Show quoted text -


Re: [jQuery] Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
Wendi, just a tip to help you get the assistance you're looking for: Since
your question doesn't seem to relate to the topic of this particular thread,
people may not notice it.

Could you re-post your question as a new post with its own title that
summarizes the question? That will help people find it who may have an
answer for you. It would also help if in that post you could describe the
problem in more detail, and explain a bit more about what it is your need to
accomplish.

Thanks!

-Mike

On Mon, Dec 14, 2009 at 4:25 PM, Wendi Turner wenditur...@gmail.com wrote:

  *How can you remove/delete the active $(document).ready() script,
 re-write and re-register then re-trigger the ready script??  Without
 reloading the page?*


Re: [jQuery] Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
Good point, thanks for noticing that, Brian.

This is a good example of why it's always helpful to post a link to a live
test page instead of just a code snippet. Then we know what the actual code
looks like and can see it run in the browser.

-Mike

On Mon, Dec 14, 2009 at 4:20 PM, brian zijn.digi...@gmail.com wrote:

 $('#somediv').append(html);

 You're appending to the div with ID 'someDiv'. But you say that this
 is the content:

 div class=somediv
   form id=someform
   p class=someclassName:/p
   input style=display: none; type=textbox
 name=somefield
 value=test /
   /p
   /form
 /div

 Note the class=somediv. I'm wondering if that's a typo and it's
 actually id=somediv, in which case you'll have 2 divs with identical
 IDs.

 Just a shot in the dark.

 On Mon, Dec 14, 2009 at 11:05 AM, joseph7 radioak...@gmail.com wrote:
  Hi,
 
  So, I'm attempting to add HTML to a document via Ajax, but when I get
  back the content, I'm finding that no matter what I try, I can't get
  it added to the DOM correctly. Basically I'm doing this:
 
  $.post('ajax.php',
  function (data) {
   var html = data.content;
   $('#somediv').append(html);
  }
  );
 
  The HTML I'm loading looks like this:
 
  div class=somediv
 form id=someform
 p class=someclassName:/p
 input style=display: none; type=textbox
 name=somefield
  value=test /
 /p
 /form
  /div
 
  While the content does show up in the div, if I try to get the form by
  doing $('#someform'), jQuery returns nothing. I've tried using .append
  () and .html(), and neither way gives me what I want. Is there
  something I'm missing here? I know adding objects to the DOM in jQuery
  is ridiculously easy, so I feel like I'm either running up against
  something impossible, or I have a hugely flawed concept of how append
  () and html() work.
 



Re: [jQuery] Re: load() function and IE8

2009-12-14 Thread Karl Swedberg
I'm not familiar with the Admintasia template. If #AP_PONum is in the  
DOM when you bind the event handler, then you shouldn't need live.  
It's only one element, so there shouldn't be a performance hit either  
if you just use bind. The only reason .bind() wouldn't work is if  
#AP_PONum isn't in the DOM when you call it (or if you later remove  
#AP_PONum and then add an element with id=AP_PONum later).


Given those caveats, this should work:

$(#AP_PONum).bind(change, function(){
ap_po = $(this).val();
$(#content-box)
	.load(webapps/finished_jewelry/PurReq/display/ 
dsp_addPurchaseRequest.cfm?poNum=+ap_po);

});

If that still doesn't work for you, we'd be able to help more  
effectively if we could see if a test page somewhere.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Dec 14, 2009, at 9:41 AM, Scott Stewart wrote:


working and supported are two different animals

This is true...

Back to my particular anomaly...

I just replaced the live call with a bind call, and now there's  
nothing

in Firefox either..

I'm using the Admintasia template
(http://www.admintasia.com). Because of the way this is set up (or  
the way
that I'm calling things) I've had to use the live function to get  
things to

work.

I think I'm right in assuming that the live function keeps the  
Ajax events

alive...

So is there a way to get around this? I can always add a submit  
button to

every dropdown I'm using but that would kind of defeat the purpose.

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

Behalf Of MorningZ
Sent: Monday, December 14, 2009 9:10 AM
To: jQuery (English)
Subject: [jQuery] Re: load() function and IE8

But if it's not supported then why would it work in Firefox? 

working and supported are two different animals

And it works because the change event does bubble events the way
that works with .live(), and, no surprise here, IE doesn't bubble
events the way that works with .live() but apparently some way
around IE's shortcomings is in place for 1.4's implementation of  
.live

()


On Dec 14, 8:56 am, Scott Stewart sstwebwo...@bellsouth.net wrote:

Thanks Karl,

But if it's not supported then why would it work in Firefox?
Secondly, would the bind method be a workaround?

Thanks

sas

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


Behalf Of Karl Swedberg
Sent: Monday, December 14, 2009 12:33 AM
To: jQuery (English)
Subject: [jQuery] Re: load() function and IE8

Hi Scott,

Take a look at the documentation for the .live() method:

Currently not supported: blur, focus, mouseenter, mouseleave,  
change,

submit

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

The change event doesn't bubble in IE, so it doesn't work with .live
(). jQuery 1.4 is going to provide a workaround for that, but as of
1.3.2, it's not supported.

On Dec 10, 5:02 pm, Scott Stewart sstwebwo...@bellsouth.net wrote:

I fat fingered the last one so...



I have this piece of code



$(#AP_PONum).live(change, function(){
   ap_po = $(option:selected,this).val();
$(#content-box).load(webapps/finished_jewelry/PurReq/display/
dsp_addPurchaseRequest.cfm?poNum=+ap_po);



});



which works like a champ in firefox.


it's called from a drop down grabs the ColdFusion template and  
load it

in a div called content-box.



This does nothing in IE8, no error, no load, no love.. nothing



any ideas on how to work around this?






Re: [jQuery] how to get value between brackets in a string

2009-12-14 Thread Karl Swedberg
to elaborate a bit, you could store the result of that line in a  
variable and then use it.

I'd do the replace a bit differently.
var n = $('#pageCount').text().replace(/[)(]/g,'');

or use .match instead:
var n = $('#pageCount').text().match(/\d+/)[0]

Now you can do something with n.

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Dec 14, 2009, at 7:48 AM, Leonardo K wrote:


$('#pageCount').text().replace(')','').replace('(','')

On Mon, Dec 14, 2009 at 10:41, tony stamp tonyst...@hotmail.co.uk  
wrote:


I have a simple span element with the id of pageCount, which has a  
value of
(5), for example. I am attempting to get the just number value  
without the
brackets, or some way of adjusting the number and leaving the  
brackets. Any

pointers?
--
View this message in context: 
http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-tp26777141s27240p26777141.html
Sent from the jQuery General Discussion mailing list archive at  
Nabble.com.







Re: [jQuery] Re: detecting edge cases when swapping divs

2009-12-14 Thread Charlie




any tests on .arrowdown will not be of benefit , you need to check for
position of it's parent .pane

since you are inserting after "p" tags in this case try this:

$(".pane .arrowdown").click(function() {
 $(this).parents(".pane").slideUp("slow",function(){
   $(this).insertAfter($(this).next()).slideDown("slow");
   if($(this).next("p").length==0) { 
$(this).find(".arrowdown").css("visibility","hidden");
   }
 });
 return false;
});

Abbey wrote:

  @Robert The code didn't work for me.

@Charlie I tried length=0 and length=1 and the pane always goes past
the footer div.

$(".pane .arrowdown").click(function() {
if($(this).next().length==1) { // charlie: will return true if at
bottom, would have to test after the animation, or use length==1 if
test before animation
		$(this).css("visibility","hidden");
		return;
	} else {

$(this).parents(".pane").slideUp("slow",function(){
			$(this).insertAfter($(this).next()).slideDown("slow");
});
return false;
	}

});

  





[jQuery] delete / remove $.ajax() object ???

2009-12-14 Thread Wendi Turner
Thank you Mike !

Repost Question: *How can you remove/delete the active $(document).ready()
script, re-write and re-register then re-trigger the ready script??  Without
reloading the page?*

I have an anonymous

$.ajax( function ( blah blah) )

created in the $document.ready() object.

I want to reload the $.ajax () object on a client event.

How can I do this best?



Michael Geary m...@mg.to

 Wendi, just a tip to help you get the assistance you're looking for: Since
 your question doesn't seem to relate to the topic of this particular thread,
 people may not notice it.



Re: [jQuery] delete / remove $.ajax() object ???

2009-12-14 Thread brian
Put your $.ajax() call inside a function and call that on load and
whatever other event.

On Mon, Dec 14, 2009 at 8:18 PM, Wendi Turner wenditur...@gmail.com wrote:
 Thank you Mike !

 Repost Question: How can you remove/delete the active $(document).ready()
 script, re-write and re-register then re-trigger the ready script??  Without
 reloading the page?

 I have an anonymous

 $.ajax( function ( blah blah) )

 created in the $document.ready() object.

 I want to reload the $.ajax () object on a client event.

 How can I do this best?



 Michael Geary m...@mg.to

 Wendi, just a tip to help you get the assistance you're looking for: Since
 your question doesn't seem to relate to the topic of this particular thread,
 people may not notice it.




Re: [jQuery] Re: detecting edge cases when swapping divs

2009-12-14 Thread Charlie




you'll have to do some more to reset the visibility to visible on the
up move of course. Was just steering you into one possible way to find
the limits

Charlie wrote:
any tests on
.arrowdown will not be of benefit , you need to check for
position of it's parent .pane
  
since you are inserting after "p" tags in this case try this:
  
$(".pane .arrowdown").click(function() {
 $(this).parents(".pane").slideUp("slow",function(){
   $(this).insertAfter($(this).next()).slideDown("slow");
   if($(this).next("p").length==0) { 
$(this).find(".arrowdown").css("visibility","hidden");
   }
 });
 return false;
});
  
Abbey wrote:
  
@Robert The code didn't work for me.

@Charlie I tried length=0 and length=1 and the pane always goes past
the footer div.

$(".pane .arrowdown").click(function() {
if($(this).next().length==1) { // charlie: will return true if at
bottom, would have to test after the animation, or use length==1 if
test before animation
		$(this).css("visibility","hidden");
		return;
	} else {

$(this).parents(".pane").slideUp("slow",function(){
			$(this).insertAfter($(this).next()).slideDown("slow");
});
return false;
	}

});

  
  





[jQuery] AUTO: Michael Lawson is out of the office (returning 12/16/2009)

2009-12-14 Thread Michael Lawson


I am out of the office until 12/16/2009.

I will be unavailable on 12/15/2009 due to travel.

Please contact Dianne Spillers for any issues with Blue Direct, or
Alexandre Antabi or Brian Grier for any issues with IBM Press Room.  For
all else you may contact Leena Paulose.  Thanks






(it's Thanksgiving)


Note: This is an automated response to your message  [jQuery] Re:
Debugging in IE sent on 12/14/09 14:31:35.

This is the only notification you will receive while this person is away.

Re: [jQuery] delete / remove $.ajax() object ???

2009-12-14 Thread Michael Geary
That sounds right on the money, Brian.

Wendi, to give an example, suppose your code is something like this:

$(document).ready( function() {
$.ajax({
...
});
});

Let's say you want to make that $.ajax call both at load time and also later
in response to a click event on some div. Then you could do:

$(document).ready( function() {

function loadSomething() {
$.ajax({
...
});
}

loadSomething();  // runs at document ready time

$('#somediv').click( loadSomething );  // runs on the click

});

It's that simple!

Note that the reference to loadSomething in the .click() call does *not*
have parentheses after it. By leaving out the parens, we avoid calling the
function immediately. Instead we simply get a reference to the function that
we pass into .click() so that jQuery can call it later on the click event.

-Mike

On Mon, Dec 14, 2009 at 5:21 PM, brian zijn.digi...@gmail.com wrote:

 Put your $.ajax() call inside a function and call that on load and
 whatever other event.

 On Mon, Dec 14, 2009 at 8:18 PM, Wendi Turner wenditur...@gmail.com
 wrote:
  Thank you Mike !
 
  Repost Question: How can you remove/delete the active
 $(document).ready()
  script, re-write and re-register then re-trigger the ready script??
 Without
  reloading the page?
 
  I have an anonymous
 
  $.ajax( function ( blah blah) )
 
  created in the $document.ready() object.
 
  I want to reload the $.ajax () object on a client event.
 
  How can I do this best?
 
 
 
  Michael Geary m...@mg.to
 
  Wendi, just a tip to help you get the assistance you're looking for:
 Since
  your question doesn't seem to relate to the topic of this particular
 thread,
  people may not notice it.
 
 



[jQuery] Couple of Questions on JQuery calling and usage

2009-12-14 Thread dshah
Hi,
I am new to JQuery so apologies if these questions are basic/stupid..

We are currently using raw javascript in most of our webapp and are
trying to use JQuery to do some dynamic form loading.. So here's my
scenario:

1. I have a select group (a group of select objects) where each select
object has a javascript call back when it's changed -- this javascript
is raw javascript and a parameter is passed in.  Beause of time
constraints we would prefer not to change all our raw javascript to
JQuery..

2. I have created a JQuery call as follows:

$(document).ready(function(){
$(select).change(function (){
var selectedItem = $(select).attr(id);
var selectedItemValues = selectedItem.split(.);

var parentMealItem = $(#form_mealItemId).val();
var rootItem = $(#form_itemId).val();

var selectedItemDiv = # + selectedItemValues[0];
var loadString = ajax-test-menu-customize.htm?selectedItem= +
selectedItem + parentMealItem= + parentMealItem + rootItem= +
rootItem;

 $('selectedItemDiv').load(loadString);
   });
 });


The corresponding HTML looks like this:
div id=parentItem class= selectGroup
   select name=28007 id=28007 size=1 style=width:30;
onChange=selectMinMaxCondiment('28386')
 option selected=selected value=00/option
 option value=11/optionoption value=22/
optionSelect 1
  /select br
  select name=28206 id=28206 size=1 style=width:30;
onChange=selectMinMaxCondiment('28386')option selected=selected
value=00/optionoption value=11/optionoption value=22/
optionSelect2
 /selectbr
/div



What I want to be able to ideally do is:
1. After my raw javascript function is done on the onChange event on a
selection, I would like it to call the JQuery function with the
parameter that was passed in to it - is this possible? If so, how?

2. I want this javascript function to be dynamic in that it should be
called for any of the select object that is changed - so if I select
the name select1 then I want the id=28007 to be selected and if I
choose select2, then I want id=28206 to be selected.. Right now, no
matter what object I select, the select always triggers the first
one that was selected - is it because this variable (selectedItem)
gets created as a global variable?

Any help is appreciated.
Thanks!
Dipita


[jQuery] Superfish sub-menus not working in IE

2009-12-14 Thread slflinders
Hi.

I just installed Superfish Dropdown Menu for Joomla 1.5 today from
extensions.joomla.org and have a couple of questions.

First, the version on extensions.joomla.org is 1.2. Is this the best
version to be using or is there something more recent? If so, how do I
get it?

Second, I configured my menu with a Menu Style of Accordian List and
Animation as Fade In. It works great in FireFox and Chrome. However,
in Internet Explorer (version 7), the sub-menu doesn't appear when I
hover over the parent menu item. What do I need to do to fix this?

Thanks.


[jQuery] Sub-menus not working in IE

2009-12-14 Thread slflinders
Hi.

I just installed Superfish Dropdown Menu for Joomla 1.5 today from
extensions.joomla.org and have a couple of questions.

First, the version on extensions.joomla.org is 1.2. Is this the best
version to be using or is there something more recent? If so, how do I
get it?

Second, I configured my menu with a Menu Style of Accordian List and
Animation as Fade In. It works great in FireFox and Chrome. However,
in Internet Explorer (version 7), the sub-menu doesn't appear when I
hover over the parent menu item. What do I need to do to fix this?

Thanks.


[jQuery] beginner help with using custom jquery ui objects.

2009-12-14 Thread David_ca
Hi,

With help from this tutorial 
http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/
I started to create my own custom ui objects based on the ui widget
factory

I am hoping somebody could help me with the object syntax.

//
Question 1) Alternate way to call a method of the widget.
I am able to call method darker() of my widget using this syntax:

$().ready(function() {
var aGreen = $('#test4 .target').green4();
$('#test4 .target').green4('darker');
});

For me it is more natural to do the same thing using the below syntax
but
it does not work. Can someone tell me why it doesn't work and/or show
my the best practice approach
to create a variable of a widget object instantiation and reference it
later.

$().ready(function() {
var aGreen = $('#test4 .target').green4();
aGreen.darker();
});

///
Question 2) How make a function return something.
Supposing my widget has a getHello() method that returns a hello
string
How do I call that method of my widget. I tried the below code but it
does not work.
$().ready(function() {
var aGreen = $('#test4 .target').green4();
console.log(response: + $('#test4 .target').green4('getHello'));

});



///
Question 3) How to pass a parameter to a function.
Supposing I have setDarker(value) function that takes a parameter
How do I invoke that function. Below is the syntax I hope would
work but it doesn't.

$().ready(function() {
var aGreen = $('#test4 .target').green4();
aGreen.setDarker(big);

});

BAnd finally below is the html code I used for testing,
Also a  link to the same code is here
http://docs.google.com/Doc?docid=0AbxHJxs0V9KvZGRucDVyNnJfMTdmZ3ZmOG4zNAhl=en

Thank you for any help
David

//
!DOCTYPE HTML PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html dir=ltr xmlns=http://www.w3.org/1999/xhtml; lang=en-
UShead profile=http://gmpg.org/xfn/11;
titleHacking at 0300 : Understanding jQuery UI widgets: A tutorial/
title

script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.min.js type=text/javascript/script
script src=http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/
jquery-ui.min.js type=text/javascript/script

script type=text/javascript
$.widget('ui.green4', {
getLevel: function () { return this._getData('level'); },
setLevel: function (x) {
var greenlevels = this._getData('greenlevels');
var level = Math.floor(Math.min(greenlevels.length-1, Math.max
(0,x)));
this._setData('level', level);
this.element.css({background: greenlevels[level]});
},
_init: function() { this.setLevel(this.getLevel()); },
darker: function() { this.setLevel(this.getLevel()-1); },
setDarker: function(value){console.log(value: +value)},
getHello: function(){hello},
lighter: function() { this.setLevel(this.getLevel()+1); },
off: function() {
this.element.css({background: 'none'});
this.destroy();
}
});

$.ui.green4.defaults = {
level: 15,
greenlevels:
['#000','#010','#020','#030','#040','#050','#060','#070','#080','#090','#0a0','#0b0','#0c0','#0d0','#0e0','#0f0',
'#fff']
};
/script

script type=text/javascript
$().ready(function() {
var aGreen = $('#test4 .target').green4();
$('#test4 .target').green4('darker');
});
/script

/head
body

div id =test4
p class=target This is a test paragraph/p
/div


/body
/html


[jQuery] How To Upload Video File Using JQuery

2009-12-14 Thread Mark Phillips
Hi,

I am looking for a way to use JQuery to upload video files.  Since
these files are so large it is important to provide a cue to the user
when the download is in progress and when it ends.

Thanks,
Mark


Re: [jQuery] How To Upload Video File Using JQuery

2009-12-14 Thread Andras Kende
Mark,

you might want to checkout:
http://swfupload.org/

Andras


On Dec 14, 2009, at 10:04 PM, Mark Phillips wrote:

 Hi,
 
 I am looking for a way to use JQuery to upload video files.  Since
 these files are so large it is important to provide a cue to the user
 when the download is in progress and when it ends.
 
 Thanks,
 Mark



[jQuery] Scrolling plugin from LearningJquery.com

2009-12-14 Thread juan-i
This is the plugin i'm referring to:
http://www.learningjquery.com/2007/10/improved-animated-scrolling-script-for-same-page-links

I was wondering if there was any way to get the script to scroll to
the section, minus 125px. If this wasn't clear enough,
http://juan-i.com.ar/clientitos/smee is the template where i'm trying
to implement it...

You see that when you click the links it scrolls fine, but because the
header is set to a fixed position, the begining of the section ends up
being below the header...

Thanks in advance, and please take into account that I don't really
know how to deal jQuery!


[jQuery] validate australian date

2009-12-14 Thread buRn
Hi does anyone know how to validate australian date?  I only have the
normal date validation and want to have the month and day switch
around.

cheers
bUrn


Re: [jQuery] validate australian date

2009-12-14 Thread Dhruva Sagar
Check out www.datejs.com it's a great library to deal with any kinds of
dates

Thanks  Regards,
Dhruva Sagar.




On Tue, Dec 15, 2009 at 8:49 AM, buRn bgen...@gmail.com wrote:

 Hi does anyone know how to validate australian date?  I only have the
 normal date validation and want to have the month and day switch
 around.

 cheers
 bUrn



[jQuery] Re: .focus() and non-IE browsers.

2009-12-14 Thread Dave Methvin
 For some reason, it seems that the .focus() method (at least how I'm
 using it) isn't properly setting the focus to what I'm specifying.

Yeah, I think that may be broken, it's already been reported.

http://dev.jquery.com/ticket/5652


Re: [jQuery] Re: .focus() and non-IE browsers.

2009-12-14 Thread T.J. Simmons
Appreciate it. My digging around online brought up old posts from 2007- 
ish, so I wasn't sure if this was just due to the implementation  
across different browsers or an actual bug. Thanks.


T.J. Simmons
Sent from my iPhone

On Dec 14, 2009, at 9:49 PM, Dave Methvin dave.meth...@gmail.com  
wrote:



For some reason, it seems that the .focus() method (at least how I'm
using it) isn't properly setting the focus to what I'm specifying.


Yeah, I think that may be broken, it's already been reported.

http://dev.jquery.com/ticket/5652


Re: [jQuery] beginner help with using custom jquery ui objects.

2009-12-14 Thread Richard D. Worth
We'd love to help answer these questions over here:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard

On Mon, Dec 14, 2009 at 7:02 PM, David_ca david.calling...@gmail.comwrote:

 Hi,

 With help from this tutorial
 http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/
 I started to create my own custom ui objects based on the ui widget
 factory

 I am hoping somebody could help me with the object syntax.

 //
 Question 1) Alternate way to call a method of the widget.
 I am able to call method darker() of my widget using this syntax:

 $().ready(function() {
var aGreen = $('#test4 .target').green4();
$('#test4 .target').green4('darker');
 });

 For me it is more natural to do the same thing using the below syntax
 but
 it does not work. Can someone tell me why it doesn't work and/or show
 my the best practice approach
 to create a variable of a widget object instantiation and reference it
 later.

 $().ready(function() {
var aGreen = $('#test4 .target').green4();
aGreen.darker();
 });

 ///
 Question 2) How make a function return something.
 Supposing my widget has a getHello() method that returns a hello
 string
 How do I call that method of my widget. I tried the below code but it
 does not work.
 $().ready(function() {
var aGreen = $('#test4 .target').green4();
console.log(response: + $('#test4 .target').green4('getHello'));

 });



 ///
 Question 3) How to pass a parameter to a function.
 Supposing I have setDarker(value) function that takes a parameter
 How do I invoke that function. Below is the syntax I hope would
 work but it doesn't.

 $().ready(function() {
var aGreen = $('#test4 .target').green4();
aGreen.setDarker(big);

 });

 BAnd finally below is the html code I used for testing,
 Also a  link to the same code is here

 http://docs.google.com/Doc?docid=0AbxHJxs0V9KvZGRucDVyNnJfMTdmZ3ZmOG4zNAhl=en

 Thank you for any help
 David


 //
 !DOCTYPE HTML PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
 www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
 html dir=ltr xmlns=http://www.w3.org/1999/xhtml; lang=en-
 UShead profile=http://gmpg.org/xfn/11;
titleHacking at 0300 : Understanding jQuery UI widgets: A
 tutorial/
 title

script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
 jquery.min.js type=text/javascript/script
script src=http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/
 jquery-ui.min.jshttp://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/%0Ajquery-ui.min.js
 type=text/javascript/script

 script type=text/javascript
 $.widget('ui.green4', {
getLevel: function () { return this._getData('level'); },
setLevel: function (x) {
var greenlevels = this._getData('greenlevels');
var level = Math.floor(Math.min(greenlevels.length-1, Math.max
 (0,x)));
this._setData('level', level);
this.element.css({background: greenlevels[level]});
},
_init: function() { this.setLevel(this.getLevel()); },
darker: function() { this.setLevel(this.getLevel()-1); },
setDarker: function(value){console.log(value: +value)},
getHello: function(){hello},
lighter: function() { this.setLevel(this.getLevel()+1); },
off: function() {
this.element.css({background: 'none'});
this.destroy();
}
 });

 $.ui.green4.defaults = {
level: 15,
greenlevels:

 ['#000','#010','#020','#030','#040','#050','#060','#070','#080','#090','#0a0','#0b0','#0c0','#0d0','#0e0','#0f0',
 '#fff']
 };
 /script

 script type=text/javascript
 $().ready(function() {
var aGreen = $('#test4 .target').green4();
$('#test4 .target').green4('darker');
 });
 /script

 /head
 body

 div id =test4
 p class=target This is a test paragraph/p
 /div


 /body
 /html



[jQuery] JQuery - CSS - style unordered list

2009-12-14 Thread huntspointer2009
Does anyone know how to create the following CSS styling effect using
JQuery:

I have several ul/ul unordered lists in one webpage:
ul
litext 01/li
litext 02/li
litext 03/li
litext 04/li
litext 05/li
litext 06/li
litext 07/li
litext 08/li
/ul
ul
litext 01/li
litext 02/li
litext 03/li
litext 04/li
litext 05/li
litext 06/li
litext 07/li
litext 08/li
/ul


I would like to convert my previous code into the following:
ul
litext 01/li
li class=colortext 02/li
li class=colortext 03/li
litext 04/li
litext 05/li
li class=colortext 06/li
li class=colortext 07/li
litext 08/li
/ul
ul
litext 01/li
li class=colortext 02/li
li class=colortext 03/li
litext 04/li
litext 05/li
li class=colortext 06/li
li class=colortext 07/li
litext 08/li
/ul

- Thank you very much (in advance):


Re: [jQuery] delete / remove $.ajax() object ???

2009-12-14 Thread Wendi Turner
Thank you Mike  Brian!!

This worked beautifully!!

On Mon, Dec 14, 2009 at 5:45 PM, Michael Geary m...@mg.to wrote:

 That sounds right on the money, Brian.

 Wendi, to give an example, suppose your code is something like this:

 $(document).ready( function() {
 $.ajax({
 ...
 });
 });

 Let's say you want to make that $.ajax call both at load time and also
 later in response to a click event on some div. Then you could do:

 $(document).ready( function() {

 function loadSomething() {
 $.ajax({
 ...
 });
 }

 loadSomething();  // runs at document ready time

 $('#somediv').click( loadSomething );  // runs on the click

 });

 It's that simple!

 Note that the reference to loadSomething in the .click() call does *not*
 have parentheses after it. By leaving out the parens, we avoid calling the
 function immediately. Instead we simply get a reference to the function that
 we pass into .click() so that jQuery can call it later on the click event.

 -Mike


 On Mon, Dec 14, 2009 at 5:21 PM, brian zijn.digi...@gmail.com wrote:

 Put your $.ajax() call inside a function and call that on load and
 whatever other event.

 On Mon, Dec 14, 2009 at 8:18 PM, Wendi Turner wenditur...@gmail.com
 wrote:
  Thank you Mike !
 
  Repost Question: How can you remove/delete the active
 $(document).ready()
  script, re-write and re-register then re-trigger the ready script??
 Without
  reloading the page?
 
  I have an anonymous
 
  $.ajax( function ( blah blah) )
 
  created in the $document.ready() object.
 
  I want to reload the $.ajax () object on a client event.
 
  How can I do this best?
 
 
 
  Michael Geary m...@mg.to
 
  Wendi, just a tip to help you get the assistance you're looking for:
 Since
  your question doesn't seem to relate to the topic of this particular
 thread,
  people may not notice it.
 
 





-- 
Wendi
cell: 949-606-4877

Energizer Bunny arrested, charged with battery.