[jQuery] Re: Asp.net AJAX form

2009-08-26 Thread k-one fathi
I want to submit the form via AJAX ,in asp.net how I can do this?

Thx


[jQuery] Re: [validate] problem of defining custom rules

2009-08-26 Thread david

Thank you very much.

On Aug 25, 8:59 am, Raju raju3...@gmail.com wrote:
 try this ,

 input id=firstname name=firstname
 minlength=2 /

 Warm Regards,

 Mari Raj K,
 Bangalore
 +91 9740765135

 On Tue, Aug 25, 2009 at 11:26 AM, david michaelg...@gmail.com wrote:

  i played with the example.html from jquery.validate 1.55 and wanted to
  make a custom rule firstname that is required, with the message please
  enter a firstname.
  My changes were in the validate :
  $(#commentForm).validate({
                rules: {
                        firstname: required
                        },
                messages: {
                        firstname: Enter your firstname
                }
        });

  and then        input id=cname name=name class=firstname
  minlength=2 /
  my problem is that it is shown as valid, even i don't enter nothing.
  i don't know what i am making wrong

  Thanks,
  David

  This is the code
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  http://
 www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
  html xmlns=http://www.w3.org/1999/xhtml;
  head
  meta http-equiv=Content-Type content=text/html;
  charset=ISO-8859-1 /
  titlejQuery validation plug-in - comment form example/title

  link rel=stylesheet type=text/css media=screen href=css/
  screen.css /

  script src=../lib/jquery.js type=text/javascript/script
  script src=../jquery.validate.js type=text/javascript/script

  !-- for styling the form --
  script src=js/cmxforms.js type=text/javascript/script

  script type=text/javascript
  $(document).ready(function() {
        $(#commentForm).validate({
                rules: {
                        firstname: required
                        },
                messages: {
                        firstname: Enter your firstname
                }
        });
  });
  /script

  style type=text/css
  #commentForm { width: 500px; }
  #commentForm label { width: 250px; }
  #commentForm label.error, #commentForm input.submit { margin-left:
  253px; }
  /style

  /head
  body

  form class=cmxform id=commentForm method=post action=
        fieldset
                legendPlease provide your name, email address (won't
  be published)
  and a comment/legend
                p
                        label for=cnameName (required, at least 2
  characters)/label
                        input id=cname name=name class=firstname
  minlength=2 /
                p
                        label for=cemailE-Mail (required)/label
                        input id=cemail name=email class=required
  email /
                /p
                p
                        label for=curlURL (optional)/label
                        input id=curl name=url class=url
  value= /
                /p
                p
                        label for=ccommentYour comment (required)/
  label
                        textarea id=ccomment name=comment
  class=required/textarea
                /p
                p
                        input class=submit type=submit
  value=Submit/
                /p
        /fieldset
  /form

  /body
  /html


[jQuery] Click Binding not Working

2009-08-26 Thread S2

I have this code that works:

var btnInput= document.getElementById('btnInput');
btnInput.addEventListener(click, showVal, true);

Why doesn't this work?

$('btnInput').click(showVal);
$('btnInput').bind('click', showVal);


[jQuery] Re: [validate] problem of defining custom rules

2009-08-26 Thread david

Let's say i want now to a custom message for a class.
then i would like to define a class firstname
and then define a message for the firstname.
my problem is that instead the error message i want i get the error
message from the required class
the javascript is
$(document).ready(function() {
jQuery.validator.addClassRules(firstname, {
  required: true,
  minlength: 2
});
$(#commentForm).validate({

messages: {
firstname: Enter your firstname
}
});
});
and the input is now
input  name=a class=firstname id=a  /
Thanks in advance,
David

Here is the whole code

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html;
charset=ISO-8859-1 /
titlejQuery validation plug-in - comment form example/title

link rel=stylesheet type=text/css media=screen href=css/
screen.css /

script src=../lib/jquery.js type=text/javascript/script
script src=../jquery.validate.js type=text/javascript/script

!-- for styling the form --
script src=js/cmxforms.js type=text/javascript/script

script type=text/javascript
$(document).ready(function() {
jQuery.validator.addClassRules(firstname, {
  required: true,
  minlength: 2
});
$(#commentForm).validate({

messages: {
firstname: Enter your firstname
}
});
});
/script

style type=text/css
#commentForm { width: 500px; }
#commentForm label { width: 250px; }
#commentForm label.error, #commentForm input.submit { margin-left:
253px; }
/style

/head
body

form class=cmxform id=commentForm method=post action=
fieldset
legendPlease provide your name, email address (won't be 
published)
and a comment/legend
p
label for=aName (required, at least 2 
characters)/label
input  name=a class=firstname id=a  /
p
label for=cemailE-Mail (required)/label
input id=cemail name=email class=required email 
/
/p
p
label for=curlURL (optional)/label
input id=curl name=url class=url value= /
/p
p
label for=ccommentYour comment (required)/label
textarea id=ccomment name=comment 
class=required/textarea
/p
p
input class=submit type=submit value=Submit/
/p
/fieldset
/form

/body
/html

On Aug 25, 8:59 am, Raju raju3...@gmail.com wrote:
 try this ,

 input id=firstname name=firstname
 minlength=2 /

 Warm Regards,

 Mari Raj K,
 Bangalore
 +91 9740765135

 On Tue, Aug 25, 2009 at 11:26 AM, david michaelg...@gmail.com wrote:

  i played with the example.html from jquery.validate 1.55 and wanted to
  make a custom rule firstname that is required, with the message please
  enter a firstname.
  My changes were in the validate :
  $(#commentForm).validate({
                rules: {
                        firstname: required
                        },
                messages: {
                        firstname: Enter your firstname
                }
        });

  and then        input id=cname name=name class=firstname
  minlength=2 /
  my problem is that it is shown as valid, even i don't enter nothing.
  i don't know what i am making wrong

  Thanks,
  David

  This is the code
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  http://
 www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
  html xmlns=http://www.w3.org/1999/xhtml;
  head
  meta http-equiv=Content-Type content=text/html;
  charset=ISO-8859-1 /
  titlejQuery validation plug-in - comment form example/title

  link rel=stylesheet type=text/css media=screen href=css/
  screen.css /

  script src=../lib/jquery.js type=text/javascript/script
  script src=../jquery.validate.js type=text/javascript/script

  !-- for styling the form --
  script src=js/cmxforms.js type=text/javascript/script

  script type=text/javascript
  $(document).ready(function() {
        $(#commentForm).validate({
                rules: {
                        firstname: required
                        },
                messages: {
                        firstname: Enter your firstname
                }
        });
  });
  /script

  style type=text/css
  #commentForm { width: 500px; }
  #commentForm label { width: 250px; }
  #commentForm label.error, #commentForm input.submit { margin-left:
  253px; }
  /style

  /head
  body

  form class=cmxform id=commentForm method=post action=
        fieldset
                legendPlease provide your name, email address (won't
  be published)
  and a comment/legend
                p
                        label for=cnameName (required, 

[jQuery] Re: Click Binding not Working

2009-08-26 Thread Richard D. Worth
You need to use the ID selector (#):
$('#btnInput').click(showVal);
$('#btnInput').bind('click', showVal);

- Richard

On Wed, Aug 26, 2009 at 2:18 AM, S2 smnthsm...@gmail.com wrote:


 I have this code that works:

 var btnInput= document.getElementById('btnInput');
 btnInput.addEventListener(click, showVal, true);

 Why doesn't this work?

 $('btnInput').click(showVal);
 $('btnInput').bind('click', showVal);


[jQuery] focus() killed by return false;

2009-08-26 Thread shenry

I have an anchor tag that, when clicked, reveals a login form. I'd
like the first field in the form to have focus when its revealed, and
I can see that it does as it's being revealed in the slide animation
but then focus is lost after return false;

any ideas?

Here is my code I'm new to jQuery, so any help is appreciated

$(function() {
$(#login a).click(function() {
$(#login).animate( { width: 300, height: 20 }, 500);
$(#login a).hide(slide, null, 500, loginCallback);
return false;
});
});

function loginCallback() {
$(#login_form).show(slide, null, 1000);
$(input.focus).focus();
}

Thanks,

Stu


[jQuery] Repeating items - how can I set the attribute name with position information

2009-08-26 Thread marc

Hi

I'm not sure how to do this..but i've got a dynamic table (rows added/
removed by the user)

I need the name attribute for the input tags add to look like

intake.answerMapped(nodeId-pos).value

i've put the nodeId into a custom attribute..so the input tag looks
something like this

input type=text nodeId=10/

the pos variable should be the position in the table (i guess this is
the position in relation to siblings)..so if i'm the 2nd row, and the
node id is 10, then the name attribute should be set to 10-2

any ideas how to do this? I know about the attr(name,value) method,
but i'm not sure how to build the nodeId-pos string to put in there.


thanks,


[jQuery] jquery.corner.js plugin not working with input elements

2009-08-26 Thread Noel Weichbrodt

I must have missed a bit of information, because I cannot get the
jquery.corner plugin to work with input html elements. The following
renders a rounded div but not a rounded input element in FF3, IE7,
IE8, and in fact causes the input box border to disappear completely.

html
head
script language=javascript type=text/javascript src=../Scripts/
jquery-1.2.6.js/script
script language=javascript type=text/javascript src=../Scripts/
jquery.corner.js/script
/head
body
script type=text/javascript language=javascript
$(document).ready(function() {
$('div.round').corner();
$('input.round').corner();
});
/script
div class=round style=background-color:#bbb;
plorem ipsum dolor sit amet./p
/div
br /
input id=Text1 value=lorem ipsum dolor sit type=text
class=round /
/body
/html

In IE7/8, a javascript error message is logged:

===
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/
4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR
3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR
1.1.4322)
Timestamp: Wed, 26 Aug 2009 05:40:52 UTC
Message: Unexpected call to method or property access.
Line: 131
Char: 17
Code: 0
URI: file:../Scripts/jquery.corner.js


Any help appreciated!


[jQuery] Dynamically Created anchor tags

2009-08-26 Thread cachobong

Hello! I need help on this. i created image links by reading an xml
and creating the img and a tags in jquery. how do i put a function in
it? i tried the function below but it doesnt seem to work. These image
links are stored in the div: thumbs

Below is the code:

$(function() {
$(#thumbs a).click(function(event) {
event.preventDefault();
alert(Hello world!);
});

$.ajax({
type: GET,
url: thumbs.xml,
dataType: xml,
success: function(xml) {
$(xml).find('thumb').each(function(){
var title_text = $(this).find('title').text();
var path_text = $(this).find('path').text();

$('a href=/a').html('img src='+ path_text +' 
alt='+
title_text +' title='+ title_text +'')
.appendTo('#thumbs');
}); //close each(
}
}); //close $.ajax(

}); //close $(

Thank you!!


[jQuery] Re: Dynamically Created anchor tags

2009-08-26 Thread Leonard Martin

You will either need to use the live plugin as follows:

$('#thumbs a').live('click',function(){...});

Or move the binding of your 'click' inside the callback function of
your $.ajax call so it would then look like:

.appendTo('#thumbs').click(function(){...});

As it is you're trying to bind onto anchors which don't exist yet.
Using $().live() allows you to bind onto all exisiting elements, and
any elements which may be created in the future.



On Aug 26, 8:54 am, cachobong f.mngt...@gmail.com wrote:
 Hello! I need help on this. i created image links by reading an xml
 and creating the img and a tags in jquery. how do i put a function in
 it? i tried the function below but it doesnt seem to work. These image
 links are stored in the div: thumbs

 Below is the code:

 $(function() {
         $(#thumbs a).click(function(event) {
                 event.preventDefault();
                 alert(Hello world!);
         });

         $.ajax({
                 type: GET,
                 url: thumbs.xml,
                 dataType: xml,
                 success: function(xml) {
                 $(xml).find('thumb').each(function(){
                         var title_text = $(this).find('title').text();
                         var path_text = $(this).find('path').text();

                         $('a href=/a').html('img src='+ path_text +' 
 alt='+
 title_text +' title='+ title_text +'')
                         .appendTo('#thumbs');
                         }); //close each(
                 }
         }); //close $.ajax(

 }); //close $(

 Thank you!!


[jQuery] Re: JQuery with Crystal Reports .Net 2.0

2009-08-26 Thread Richard D. Worth
You may be running into problems because the jQuery UI Dialog (I assume
that's what you meant by jQuery dialog) moves the dialog content to the end
of the body to get around an IE6 stacking issue. This can sometimes cause
issues with forms. If you need any more help, there's a dedicated list for
jQuery UI questions
http://groups.google.com/group/jquery-ui

- Richard

On Tue, Aug 25, 2009 at 1:06 PM, ND desaid...@gmail.com wrote:


 Hello,

 Has anyone attempted using JQuery dialog to display crystal reports
 in .Net 2.0? Also, the crystal report viewer is within and AJAX update
 panel. We are trying to implement that and having nightmarish issues
 with printing and exporting the reports. If I use full postbacks from
 the report viewer, it closes the JQuery dialog. If I use async
 postbacks, there is no event to trigger the printing. Has anyone
 experienced this?

 Any help is greatly appreciated.

 Thanks,
 ND



[jQuery] Re: Dynamically Created anchor tags

2009-08-26 Thread cachobong

Thanks! i tried the 2nd solution and it worked!

On Aug 26, 5:14 pm, Leonard Martin leonard.mar...@gmail.com wrote:
 You will either need to use the live plugin as follows:

 $('#thumbs a').live('click',function(){...});

 Or move the binding of your 'click' inside the callback function of
 your $.ajax call so it would then look like:

 .appendTo('#thumbs').click(function(){...});

 As it is you're trying to bind onto anchors which don't exist yet.
 Using $().live() allows you to bind onto all exisiting elements, and
 any elements which may be created in the future.

 On Aug 26, 8:54 am, cachobong f.mngt...@gmail.com wrote:

  Hello! I need help on this. i created image links by reading an xml
  and creating the img and a tags in jquery. how do i put a function in
  it? i tried the function below but it doesnt seem to work. These image
  links are stored in the div: thumbs

  Below is the code:

  $(function() {
          $(#thumbs a).click(function(event) {
                  event.preventDefault();
                  alert(Hello world!);
          });

          $.ajax({
                  type: GET,
                  url: thumbs.xml,
                  dataType: xml,
                  success: function(xml) {
                  $(xml).find('thumb').each(function(){
                          var title_text = $(this).find('title').text();
                          var path_text = $(this).find('path').text();

                          $('a href=/a').html('img src='+ path_text 
  +' alt='+
  title_text +' title='+ title_text +'')
                          .appendTo('#thumbs');
                          }); //close each(
                  }
          }); //close $.ajax(

  }); //close $(

  Thank you!!


[jQuery] not able to append new tag in XML in IE

2009-08-26 Thread g...@iec

I am making an ajax call and in response, i am getting an XML.
And then using data from XML, i am creating a form.
I stored response XMl in a variable like this
 var xmlData  = $(data);
If there is any change in any field of  form then i am changing
corresponding node value in xmlData
by appending new node in related node like this :
 var val = document.createElement('{nodename}');
$(val).text({changed value});
$({corresponding node}).append($(val));

This is working fine in FF but not working in IE.

Kindly guide me how can i solve this problem.

Thanks in advance to all for providing guidance.


[jQuery] Re: Passing variables to .click

2009-08-26 Thread Richard D. Worth
Another option would be to use the metadata plugin:
http://plugins.jquery.com/project/metadata

- Richard

On Tue, Aug 25, 2009 at 7:59 AM, AMP ampel...@gmail.com wrote:


 Good one,
 Thanks

 On Aug 24, 4:02 pm, James james.gp@gmail.com wrote:
  Since region is not a valid HTML attribute, other ways is to set an
  ID on the element and use that as a reference to data stored elsewhere
  (e.g. a Javascript array or object).
  Depending on whether you have a lot of data or not. Assuming you have
  many onclicks on your page, here's another way to do it.
 
  script
  // JS object
  var myData = {id1:'US', id2:'Europe', id3:'Antarctica'};
 
  $(div.clickme).click(function() {
 var id = this.id;  // 'id1' or 'id2' or 'id3'
 alert(myData.id);  // 'US' or 'Europe' or 'Antarctica'
 // alert(myData[id]);  // same as above});
 
  /script
 
  div id=id1 class=clickmeText 1/div
  div id=id2 class=clickmeText 2/div
  div id=id3 class=clickmeText 3/div
 
  On Aug 23, 2:40 pm, AMP ampel...@gmail.com wrote:
 
 
 
   This is the way I was thinking so could you give me another example
   without attributes (Just so I could learn a different way).
   Thnaks
 
   On Aug 23, 8:05 pm, MorningZ morni...@gmail.com wrote:
 
MANY ways to do this, with this being one of them
 
button id=parsetablebutton region=?php echo $Region ?Some
Text/button
 
then
 
$(#parsetablebutton).click(function() {
var region = $(this).attr(region);  //-- the value from
PHP
 
});
 
again, that's just one way of many
 
On Aug 23, 6:04 pm, AMP ampel...@gmail.com wrote:
 
 Hello,
 I was using this:
 onClick=parsetable('?php echo $Region ?')
 
 but now I want to use the JQuery:
 $(#parsetablebutton).click( function() {
 
 How do I pass the parameter to the function?
 Would I set an attribute and read it with[att=XXX] where the
 attribute
 is the echo'd $Region or is there a better way?
 Thanks- Hide quoted text -
 
- Show quoted text -- Hide quoted text -
 
  - Show quoted text -


[jQuery] Re: not able to append new tag in XML in IE

2009-08-26 Thread Paolo Chiodi

when you do document.createElement you create an element that is child
of document document.
Try to create the element with data.createElement.

Paolo

On Wed, Aug 26, 2009 at 10:14 AM, g...@iecabhi.pur...@gmail.com wrote:

 I am making an ajax call and in response, i am getting an XML.
 And then using data from XML, i am creating a form.
 I stored response XMl in a variable like this
  var xmlData  = $(data);
 If there is any change in any field of  form then i am changing
 corresponding node value in xmlData
 by appending new node in related node like this :
  var val = document.createElement('{nodename}');
 $(val).text({changed value});
 $({corresponding node}).append($(val));

 This is working fine in FF but not working in IE.

 Kindly guide me how can i solve this problem.

 Thanks in advance to all for providing guidance.



[jQuery] Re: jQuery.sortable with block containing javascript

2009-08-26 Thread Richard D. Worth
Could you create a test page and attach to a new ticket here?
http://dev.jqueryui.com/newticket (note: requires registration)

Thanks.

- Richard

On Wed, Aug 26, 2009 at 2:47 AM, B3nitro b3ni...@gmail.com wrote:


 Hi,

 I'm new with jQuery and javascript framework in general, I've a
 little problem with the the sortable plugin.

 The code of my page looks like this  :
 html
 body
 div id=container
 !-- Some divs --
 div class=menuNormal content/div
 !-- Bugs is here... --
 div class=comment
  div class=datescript type=text/
 javascriptdocument.write(date('d/m/Y à g:i a',1251265362));/
 script/div
  div class=contentSome text/div
 /div
 !-- ... --
 div class=footerNormal content/div
 /div
 /body
 script type=text/javascript
 $(document).ready(function()
 {
 $(#container).sortable({ cursor: 'crosshair', containment: 'parent',
 opacity: 0.6, scroll: true });
 });
 /script
 /html

 All div class=comment make crash the browser on dropping them (drag
 work), others div's like menu and footer works well.

 Do you have an idea to make div with js inside sortable ?

 Thanks in advance :)



[jQuery] Re: Dynamically Created anchor tags

2009-08-26 Thread Paolo Chiodi

live is no longer a plugin, but core of jquery

Paolo

On Wed, Aug 26, 2009 at 10:14 AM, Leonard
Martinleonard.mar...@gmail.com wrote:

 You will either need to use the live plugin as follows:

 $('#thumbs a').live('click',function(){...});

 Or move the binding of your 'click' inside the callback function of
 your $.ajax call so it would then look like:

 .appendTo('#thumbs').click(function(){...});

 As it is you're trying to bind onto anchors which don't exist yet.
 Using $().live() allows you to bind onto all exisiting elements, and
 any elements which may be created in the future.



 On Aug 26, 8:54 am, cachobong f.mngt...@gmail.com wrote:
 Hello! I need help on this. i created image links by reading an xml
 and creating the img and a tags in jquery. how do i put a function in
 it? i tried the function below but it doesnt seem to work. These image
 links are stored in the div: thumbs

 Below is the code:

 $(function() {
         $(#thumbs a).click(function(event) {
                 event.preventDefault();
                 alert(Hello world!);
         });

         $.ajax({
                 type: GET,
                 url: thumbs.xml,
                 dataType: xml,
                 success: function(xml) {
                 $(xml).find('thumb').each(function(){
                         var title_text = $(this).find('title').text();
                         var path_text = $(this).find('path').text();

                         $('a href=/a').html('img src='+ path_text 
 +' alt='+
 title_text +' title='+ title_text +'')
                         .appendTo('#thumbs');
                         }); //close each(
                 }
         }); //close $.ajax(

 }); //close $(

 Thank you!!


[jQuery] Re: Dynamically Created anchor tags

2009-08-26 Thread Leonard Martin

Of course, just pure force of habit still makes me call it a plugin.



On Aug 26, 9:51 am, Paolo Chiodi chiod...@gmail.com wrote:
 live is no longer a plugin, but core of jquery

 Paolo

 On Wed, Aug 26, 2009 at 10:14 AM, Leonard

 Martinleonard.mar...@gmail.com wrote:

  You will either need to use the live plugin as follows:

  $('#thumbs a').live('click',function(){...});

  Or move the binding of your 'click' inside the callback function of
  your $.ajax call so it would then look like:

  .appendTo('#thumbs').click(function(){...});

  As it is you're trying to bind onto anchors which don't exist yet.
  Using $().live() allows you to bind onto all exisiting elements, and
  any elements which may be created in the future.

  On Aug 26, 8:54 am, cachobong f.mngt...@gmail.com wrote:
  Hello! I need help on this. i created image links by reading an xml
  and creating the img and a tags in jquery. how do i put a function in
  it? i tried the function below but it doesnt seem to work. These image
  links are stored in the div: thumbs

  Below is the code:

  $(function() {
          $(#thumbs a).click(function(event) {
                  event.preventDefault();
                  alert(Hello world!);
          });

          $.ajax({
                  type: GET,
                  url: thumbs.xml,
                  dataType: xml,
                  success: function(xml) {
                  $(xml).find('thumb').each(function(){
                          var title_text = $(this).find('title').text();
                          var path_text = $(this).find('path').text();

                          $('a href=/a').html('img src='+ path_text 
  +' alt='+
  title_text +' title='+ title_text +'')
                          .appendTo('#thumbs');
                          }); //close each(
                  }
          }); //close $.ajax(

  }); //close $(

  Thank you!!


[jQuery] Re: Flash effect with show/hide

2009-08-26 Thread guidebook

I've resolved the problem.
It was that my hover event didn't work anymore after a ajax call.

Here is an interesting article: 
http://jetlogs.org/2009/01/29/re-binding-jquery-events-on-ajax-callbacks/

Thanks for the help!

On 25 août, 12:49, guidebook fveeva...@gmail.com wrote:
 Thanks for your help:)

 I have another problem though. The event is only fired twice. You can
 view the page here :http://www.best-radio.net/index.php
 The caption must appear for five seconds when you hover a cover art
 and then disappear. But it only works twice.

 Anyone have an idea?

 On Aug 25, 12:23 pm, Liam Byrne l...@onsight.ie wrote:



  Use hoverIntent instead of hover - it's child-friendly in this regard

  L

  guidebook wrote:
   Hello,

   (Sorry for my english, it isn't my native language.)

   I would want to show a div (the information about the song) when the
   visitor hover on a cover art on a radio website but this div overlap
   the cover art with an opacity of 0.7

   You can see an example here:http://www.cestici.info/test.jpg

   The problem is that when the information div appears, the mouse
   pointer isn't on the cover art div anymore for the navigator so the
   information div disappears, and so on... resulting in a flash effect.

   How can I do this without the flash effect?

   Thanks for your help :)
   

   No virus found in this incoming message.
   Checked by AVG -www.avg.com
   Version: 8.5.409 / Virus Database: 270.13.66/2325 - Release Date: 
   08/25/09 06:08:00


[jQuery] Re: validate classbased via ajax request

2009-08-26 Thread Jörn Zaefferer

Writing a custom remote method is currently not supported. You'd have
to copy the existing remote method. Instead, try to put the local
custom validation into its own method, and use the remote method in
addition, for the same field:
http://docs.jquery.com/Plugins/Validation/Methods/remote

Jörn

On Wed, Aug 26, 2009 at 2:38 AM, Jan Limpensjan.limp...@gmail.com wrote:
 Hello,

 my forms are all css class based validated. Now I need to check some on them
 serverside, so I overload the regular validation methods (or is there a
 better way?).

     jQuery.validator.addMethod(date, function(value, element) {
     var preValid = this.optional(element) ||
 /^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(value);
     if (!preValid)
     return false;
     $.getJSON(urlDefs.validateDate + ?date= + value, function(data) {
     var result = data.Data;
     // what can I do with this result?
     // how can I set element valid?
     });
     }, jQuery.validator.messages['date']);

 I might be doing something wrong...
 I know there is a remote({}) method, but how could I use it from there? It
 might work less asynchronously, thus easier...
 --
 Jan



[jQuery] Quick question, basic stuff

2009-08-26 Thread Bart

Hi all,

In a HTML document I'm having a few divs with the same class. In each
of this divs is nested an unordered list with inside the list items
some anchors. I'm trying to find a certain jquery expression which
says I want link#3 from div#2. I've tried;

$(div.pic:eq(1) ul li a:eq(2)).hide();

which doesn't seem to work... I think because you can't have :eq()
twice as selector. How would I make this work?


[jQuery] Datepicker issue

2009-08-26 Thread sak

Hi there

I have a problem with the date picker and was wondering if something
had already been developed to sort it out, or whether I would need to
do one myself.

With a datepicker in the webapp we are developing, we want to allow
users to view data based on past dates (ie anything from an old date
up to present date). So with this in mind I have set the max date on
the datepicker like this {maxDate: +0} so users can't pick dates
beyond today.

However if the user manually enters the dates (say beyond the maxDate)
then nothing happens. The date input holds the date entered even if it
is beyond the maxDate set.

What I want it to do, is if the users manually types in a date (if
that date is beyond the maxDate set) then it should revert back to the
maxDate.

can the datepicker do this?

Any help will be awesome
Thanks
Sak



[jQuery] Re: not able to append new tag in XML in IE

2009-08-26 Thread g...@iec

Thanks for your reply.
But this is not working.The data which i got as a result from ajax
call on success, i stored it in a global variable.
Like this
var xmlData = $(data);
But when i was executing like you told, it is not creating an
element.

On Aug 26, 1:49 pm, Paolo Chiodi chiod...@gmail.com wrote:
 when you do document.createElement you create an element that is child
 of document document.
 Try to create the element with data.createElement.

 Paolo

 On Wed, Aug 26, 2009 at 10:14 AM, g...@iecabhi.pur...@gmail.com wrote:

  I am making an ajax call and in response, i am getting an XML.
  And then using data from XML, i am creating a form.
  I stored response XMl in a variable like this
   var xmlData  = $(data);
  If there is any change in any field of  form then i am changing
  corresponding node value in xmlData
  by appending new node in related node like this :
   var val = document.createElement('{nodename}');
  $(val).text({changed value});
  $({corresponding node}).append($(val));

  This is working fine in FF but not working in IE.

  Kindly guide me how can i solve this problem.

  Thanks in advance to all for providing guidance.


[jQuery] Re: not able to append new tag in XML in IE

2009-08-26 Thread Paolo Chiodi

You don't have to use xmlData, which is the jquery object, but data
which is the xml dom (if you set xml as type of the request)

Paolo

On Wed, Aug 26, 2009 at 12:35 PM, g...@iecabhi.pur...@gmail.com wrote:

 Thanks for your reply.
 But this is not working.The data which i got as a result from ajax
 call on success, i stored it in a global variable.
 Like this
 var xmlData = $(data);
 But when i was executing like you told, it is not creating an
 element.

 On Aug 26, 1:49 pm, Paolo Chiodi chiod...@gmail.com wrote:
 when you do document.createElement you create an element that is child
 of document document.
 Try to create the element with data.createElement.

 Paolo

 On Wed, Aug 26, 2009 at 10:14 AM, g...@iecabhi.pur...@gmail.com wrote:

  I am making an ajax call and in response, i am getting an XML.
  And then using data from XML, i am creating a form.
  I stored response XMl in a variable like this
   var xmlData  = $(data);
  If there is any change in any field of  form then i am changing
  corresponding node value in xmlData
  by appending new node in related node like this :
   var val = document.createElement('{nodename}');
  $(val).text({changed value});
  $({corresponding node}).append($(val));

  This is working fine in FF but not working in IE.

  Kindly guide me how can i solve this problem.

  Thanks in advance to all for providing guidance.


[jQuery] Re: Quick question, basic stuff

2009-08-26 Thread Paolo Chiodi

one way could be $('div.pic:eq(1)').find('ul li a:eq(2))

Paolo

On Wed, Aug 26, 2009 at 12:17 PM, Bartyourps3playsps1ga...@gmail.com wrote:

 Hi all,

 In a HTML document I'm having a few divs with the same class. In each
 of this divs is nested an unordered list with inside the list items
 some anchors. I'm trying to find a certain jquery expression which
 says I want link#3 from div#2. I've tried;

 $(div.pic:eq(1) ul li a:eq(2)).hide();

 which doesn't seem to work... I think because you can't have :eq()
 twice as selector. How would I make this work?


[jQuery] Re: Quick question, basic stuff

2009-08-26 Thread Bart

Thanks! I'll try that, just for my knowledge, any other ways?

On Aug 26, 12:50 pm, Paolo Chiodi chiod...@gmail.com wrote:
 one way could be $('div.pic:eq(1)').find('ul li a:eq(2))

 Paolo



 On Wed, Aug 26, 2009 at 12:17 PM, Bartyourps3playsps1ga...@gmail.com wrote:

  Hi all,

  In a HTML document I'm having a few divs with the same class. In each
  of this divs is nested an unordered list with inside the list items
  some anchors. I'm trying to find a certain jquery expression which
  says I want link#3 from div#2. I've tried;

  $(div.pic:eq(1) ul li a:eq(2)).hide();

  which doesn't seem to work... I think because you can't have :eq()
  twice as selector. How would I make this work?


[jQuery] Re: $.ajax calls in firefox doesn't work

2009-08-26 Thread hosemaria

Wow. It works with GET :)
Thanx to all

Greetings


[jQuery] Get total items in jcarousel

2009-08-26 Thread ProbablyMike

Hi,

Using the jcarousel plugin fine, but would like to get the number of
items in the jcarousel.

I see there are carousel.first and carousel.last variables but they
are for only the visible items, not the total in the whole jcarousel.

Is this possible?

Cheers,
Mike


[jQuery] Re: not able to append new tag in XML in IE

2009-08-26 Thread g...@iec

In ajax call, i set dataType as 'xml' and on success, i call a
function in which i am passing xml which i got as response.
And in the function i a assigning  that data to a global variable so
that i can access it from any function.
I am assigning it to a global variable as shown below :
xyz : function(data){
  xmlData = $(data);
 .

}
like this and then i need to modify xmldata if there is any change in
form and on submit of form, i am sending xmlData back to server using
ajax call.

So please guide me accordingly to modify xml in global variable on
change in form data from any other function.

On Aug 26, 3:47 pm, Paolo Chiodi chiod...@gmail.com wrote:
 You don't have to use xmlData, which is the jquery object, but data
 which is the xml dom (if you set xml as type of the request)

 Paolo

 On Wed, Aug 26, 2009 at 12:35 PM, g...@iecabhi.pur...@gmail.com wrote:

  Thanks for your reply.
  But this is not working.The data which i got as a result from ajax
  call on success, i stored it in a global variable.
  Like this
  var xmlData = $(data);
  But when i was executing like you told, it is not creating an
  element.

  On Aug 26, 1:49 pm, Paolo Chiodi chiod...@gmail.com wrote:
  when you do document.createElement you create an element that is child
  of document document.
  Try to create the element with data.createElement.

  Paolo

  On Wed, Aug 26, 2009 at 10:14 AM, g...@iecabhi.pur...@gmail.com wrote:

   I am making an ajax call and in response, i am getting an XML.
   And then using data from XML, i am creating a form.
   I stored response XMl in a variable like this
    var xmlData  = $(data);
   If there is any change in any field of  form then i am changing
   corresponding node value in xmlData
   by appending new node in related node like this :
    var val = document.createElement('{nodename}');
   $(val).text({changed value});
   $({corresponding node}).append($(val));

   This is working fine in FF but not working in IE.

   Kindly guide me how can i solve this problem.

   Thanks in advance to all for providing guidance.


[jQuery] Re: Datepicker issue

2009-08-26 Thread sak

Yeah, I was wanting to avoid the need to write a function..or
freezing the textbox.to me it seems wierd or inconsistant that the
datepicker won't allow you to pick a date beyond the maxDate, but you
can enter it manually and nothing happens (it should revert back to
the maxDate)..

anyways all good, I guess I'll have to add that functionality myself..
Thanks though

On Aug 26, 11:47 am, rupak mandal rupakn...@gmail.com wrote:
 hi,
 you can try this

 $(#datepicker).change(function() {
          var date1=$(#datepicker).val();
          var myday = new Date(date1);
          var today=  new Date();
          var one_day=1000*60*60*24;
          chan_date=Math.ceil((myday.getTime()-today.getTime())/(one_day));

          var month = myday.getMonth()+1;
          if(month10)
             month=0+month;

          var dat=myday.getDate();
          if(dat10)
             dat=0+dat;

     if(chan_date0)

 $(#datepicker).attr(value,month+/+dat+/+myday.getFullYear())
       });

  });

 but the better option is that restrict the user to enter date manually. Made
 the datepicker text box readonly.

 Thanks
 Rupak

 On Wed, Aug 26, 2009 at 3:25 AM, sak saks...@gmail.com wrote:

  Hi there

  I have a problem with the date picker and was wondering if something
  had already been developed to sort it out, or whether I would need to
  do one myself.

  With a datepicker in the webapp we are developing, we want to allow
  users to view data based on past dates (ie anything from an old date
  up to present date). So with this in mind I have set the max date on
  the datepicker like this {maxDate: +0} so users can't pick dates
  beyond today.

  However if the user manually enters the dates (say beyond the maxDate)
  then nothing happens. The date input holds the date entered even if it
  is beyond the maxDate set.

  What I want it to do, is if the users manually types in a date (if
  that date is beyond the maxDate set) then it should revert back to the
  maxDate.

  can the datepicker do this?

  Any help will be awesome
  Thanks
  Sak


[jQuery] innerWidth doesn't count scrollbars in Safari/Chrome

2009-08-26 Thread BaBna

Hi,

Does anyone knows a method to measure the scrollbar's width, which
works in Safari/Chrome.
The innerWidth function doesn't seem to take the scrollbar's width
into account when measuring the innerWidth of the child element of a
scrollbared element.

Thanks!


[jQuery] Chaining AJAX calls in jQuery with pause?

2009-08-26 Thread pascal.nauj...@googlemail.com

Hi Group,

is there a possibility to chain AJAX Requests?

By now i have 5 AJAX Functions where one calls the next (Button Click
-
 1 - 2 - 3 - 4 - 5 - Finish)



My main problem is that i have to wait about 10 seconds before the 3.
function calls the 4. When i use
sT1 = window.setTimeout(function(){ function_4() }, 1); in
function 3 my result gets mixed up. eg the dom manipulation of
function 1 is reverted (strange - i know).


I also tried the pause the Cookbook wait function (http://
docs.jquery.com/Cookbook/wait) but i can't get them to run with my
ajax statements. I tryed something like $.wait(10).ajax({url:
smtpCheck.php,  data: .


Thanks in advance
Pascal


[jQuery] Selected value in a dropdown fails

2009-08-26 Thread nordic_dev

I've got a form with some field to post. There is two dropdowns
(select -
options). If the user doesn't fill all required fields, the form
appear
again after the post, and the correct values should be present.

The first dropdown gets filled stright from the database. The options
in
the second dropwdown depends on the selected one in the first
dropdown.

The first dropdown works just fine, the option is present, and
selected
with $('#area').val(area);

The options is present in the second dropdown  (filled with
jQuery.getJSON).

My problem is that I can't get the option to be selected as with the
first
dropdown, even if I hardcode $('#daytime').val(daytime), that is
daytime
is different given values (so there should not be a problem using the
right value).

I've tried to set $('#daytime').val(daytime) in the same script as the
first one, that both choose the option in the first dropdown and fills
the
second dropdown but no luck so far.

I've also tried to create it's own script just to select the option.

So, it works in the first case, but not the other one.

Any help would be much appreciated.

/jonas


CODE SNIPPET:

script type=text/javascript

jQuery(document).ready(function(){

var area = ?php echo $_SESSION['signup_area']; ?
$('#area').val(area);


  var selectedArea = jQuery(#area option:selected);

  if(selectedArea.val() != 0)
  {
jQuery.getJSON(daytime.php,
 
{ id: selectedArea.val() },

 
function(j)
 
{
 
jQuery('#daytime options').remove();

 
var options = 'option value=Vauml;lj/option';

 
for (var i = 0; i  j.length; i++)
 
{
 
options += 'option value=' +
 
j[i].optionValue + '' +
 
j[i].optionDisplay + '/option';

}

 
jQuery(#daytime).html(options);

}
);   // end getJSON

}


// *** this part doesn't work ***

var daytime = ?php echo $_SESSION
['signup_day_time']; ?
$('#daytime').val(daytime);
});


select name=area style=width: 190px id=area
option value=0Vauml;lj/option

?php
$db = JFactory::getDBO();
$db-setQuery ('SELECT * FROM 
area ORDER BY id');
$rows = $db-loadObjectList();

foreach ($rows as $item)
{
echo 'option 
value='.$item-id.''.$item-theArea.'/
option';
}
?

/select

select name=daytime style=width: 190px
id=daytime
option value=0Vauml;lj/
option
/select



Download this as a file


[jQuery] Re: Chaining AJAX calls in jQuery with pause?

2009-08-26 Thread MorningZ

Check out the Ajax Queue plugin

http://www.google.com/search?q=jquery+ajaxqueue


On Aug 26, 8:52 am, pascal.nauj...@googlemail.com
pascal.nauj...@googlemail.com wrote:
 Hi Group,

 is there a possibility to chain AJAX Requests?

 By now i have 5 AJAX Functions where one calls the next (Button Click
 -

  1 - 2 - 3 - 4 - 5 - Finish)

 My main problem is that i have to wait about 10 seconds before the 3.
 function calls the 4. When i use
 sT1 = window.setTimeout(function(){ function_4() }, 1); in
 function 3 my result gets mixed up. eg the dom manipulation of
 function 1 is reverted (strange - i know).

 I also tried the pause the Cookbook wait function (http://
 docs.jquery.com/Cookbook/wait) but i can't get them to run with my
 ajax statements. I tryed something like $.wait(10).ajax({    url:
 smtpCheck.php,  data: .

 Thanks in advance
 Pascal


[jQuery] Re: Realtime ajax response

2009-08-26 Thread Josip Lazic

On 25 kol, 11:31, bram brammele...@gmail.com wrote:
 A more 'ajax approach' would be to resize your images individually as
 they are requested by the browser. ie: get rid of the loop in php and
 apply it in html/js.

That is not an option, for more than one reason :)

OK, is there a way to get semi realtime response using jQuery and PHP,
similar to using target='iframe'...?


[jQuery] Re: IE Superfish z-indexing problem

2009-08-26 Thread rupak mandal
Hi,
This problem is due to position relative in sf-menu ul class . If you
change the position to absolute i think it will work.


thanks
Rupak



On Wed, Aug 26, 2009 at 5:17 AM, mr.amazing kenanrahm...@gmail.com wrote:


 I know, I know, this is a common problem. Well, after trying every
 combination of z-index values for all elements on my page, I decided
 to consult an expert on the matter, The problem can be seen here:

 http://traceurl.com/go/917/demo

 I have the RokSlideshow module installed, as you can see. I modified
 the js for the slideshow to stop the increasing z-index on images with
 no luck. I set the z-index to the items in the menu to 100 and
 still got nothing. Please help!

 Thanks,
 mr.amazing



[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread John

Thanks.

Here is the html source,

 div id=x-form-el-ext-comp-1043 class=x-form-element
style=padding-left: 130px;
div id=ext-gen438 class=x-form-field-wrap style=width:
360px;
input id=programId type=hidden name=programId
value=/
input id=ext-comp-1043 class=x-form-text x-form-field
x-combo-noedit type=text autocomplete=off
   size=24 readonly=true style=width: 343px;/
img id=ext-gen439 class=x-form-trigger x-form-arrow-
trigger style=overflow: auto; width: 356px; height: 100px;
src=images/s.gif/
/div
/div

The style in the jQuery selector should match the one defined in the
html source. I wonder if I
did any other thing wrong here.

Thanks,

John
On Aug 26, 6:45 am, Paolo Chiodi chiod...@gmail.com wrote:
 Maybe that that the style attribute value should be exactly equal to
 the one contained in html. I think style=A:B C:D doesn't match
 style=C:D A:B.
 May also be that the browser has an internal rapresentation of the
 style attribute slightly different from the one written in the html
 (never tried to see with firebug some differen orders?).

 Otherwise if you create the style attribute by using .css('A','B'),
 you can't be sure of what the entire style attribute could be.

 Paolo

 On Tue, Aug 25, 2009 at 11:22 PM, Johnjian.fang.subscr...@gmail.com wrote:

  Thanks Maurício for your quick response.

  I have a program to automatically generate jQuery selectors based on
  some UI element attributes and seems your syntax is not always
  working. For example,

  1) working:  $('div:has(input[type=text][readonly=true], img
  [style=overflow: auto; width: 356px; height: 100px;]) img')

  2) Not working: $('div:has(input[type=text][readonly=true]
  [style=width: 343px;], img[style=overflow: auto; width: 356px;
  height: 100px;]) img')

  3) Not working:  $('div:has(input[type=text][readonly=true], img
  [style=overflow: auto; width: 356px; height: 100px;]) img
  [style=overflow: auto; width: 356px; height: 100px;]')

  4) Not working:  $('div:has(input[type=text][readonly=true]
  [style=width: 343px;], img[style=overflow: auto; width: 356px;
  height: 100px;]) img[style=overflow: auto; width: 356px; height:
  100px;]')

  Here not working means it returns empty object where it should
  return non-empty object.

  Do you know what is wrong?

  Thanks again,

  John

  On Aug 25, 2:50 pm, Mauricio \(Maujor\) Samy Silva
  css.mau...@gmail.com wrote:
  Sintax for the selector is:

  $('img[style=overflow: auto; width: 356px; height: 100px;]')

  Maurício
    -Mensagem Original-
    De: John
    Para: jQuery (English)
    Enviada em: terça-feira, 25 de agosto de 2009 14:36
    Assunto: [jQuery] jQuery selector for style attribute

    Hi,

    I want to select the following image using jQuery selector to see if I
    could use the style attribute,

    img id=ext-gen439 class=x-form-trigger x-form-arrow-trigger
    style=overflow: auto; width: 356px; height: 100px; src=images/
    s.gif/

    but seems the selector

    img[style=overflow: auto; width: 356px; height: 100px;]

    does not work at all. What would be the correct selector for the style
    attribute?

    Thanks in advance,

    John


[jQuery] Re: .load() doesn't work on first call in FF3 and IE (But works in FF3.5)?

2009-08-26 Thread D A

After a lot more testing, I think I know what's going on. I'm not sure
if it's a jQuery issue or javascript in general.

I've asked this on the FancyBox group, but thought I'd ask in here too
as I have a hunch it's a more universal concept with jQuery that I
need to grasp.

What my script is doing:

 - calling .load() to populate a DIV with external content
 - calling fancyBox() to then display said DIV with content as a modal window.

The end results is that I get a modal window that shows the contents
of the div from the LAST .load()

What I think happens is:

 1) jquery Loads content into div but does NOT render it yet.
 2) fancyBox grabs div but does NOT render it yet.
 3) jquery call ends so it then begins the rendering
 4) loaded content is displayed inside of DIV
 5) Fancy box displays the div as it was before render (ie, the
original blank DIV).

Is that a correct understanding? In otherwords, in any particular
chain of events in jQuery, all events are performed and then they are
all rendered, rather than going one-by-one through each event.

If that is a correct understanding, any suggestions as to how to get
the visual result that I want?

-DA


[jQuery] Re: How to cancel an AJAX request?

2009-08-26 Thread Hector Virgen
Thanks, Rupak, but I was hoping to be able to accomplish this without a
plugin. What I'm thinking of doing is storing the XMLHttpRequest object as a
local variable early on, like in the beforeSend callback.
var xmlHttpRequest = null;

$.ajax({
/* ... */
beforeSend: function(request)
{
xmlHttpRequest = request;
}
});

$.('button.canel').click(function(event)
{
if (null !== xmlHttpRequest) {
xmlHttpRequest.abort();
xmlHttpRequest = null;
}
event.preventDefault();
});

I am not sure if this would cause any issues with the overall ajax
lifecycle. For example, if the cancel button was clicked, would the error
callback be executed? I'll have to test it and see.

--
Hector


On Tue, Aug 25, 2009 at 9:00 PM, rupak mandal rupakn...@gmail.com wrote:

 Hi Hector,
 you have to use abort function.

 go through this link http://www.protofunc.com/scripts/jquery/ajaxManager/


 Thanks
 Rupak


 On Wed, Aug 26, 2009 at 2:25 AM, Hector Virgen djvir...@gmail.com wrote:

 Hello,
 Is there a way to stop or cancel an ajax request on demand, similar to
 pressing stop in the browser? I would like to provide the user with a
 cancel button on a loading dialog that, when clicked, closes the dialog
 and cancels the ajax request. I have the dialog working (thanks to
 jQuery-UI) but pressing cancel only closes the it.

 I do not want simply ignore the response because I have a success
 callback that does some heavy manipulation of the response HTML that I'd
 like to prevent from running when the user cancels.

 Any help would be appreciated. Thanks!

 --
 Hector





[jQuery] Re: How to cancel an AJAX request?

2009-08-26 Thread Cesar Sanz
Why to re-invent the wheel?
  - Original Message - 
  From: Hector Virgen 
  To: jquery-en@googlegroups.com 
  Sent: Wednesday, August 26, 2009 9:43 AM
  Subject: [jQuery] Re: How to cancel an AJAX request?


  Thanks, Rupak, but I was hoping to be able to accomplish this without a 
plugin. What I'm thinking of doing is storing the XMLHttpRequest object as a 
local variable early on, like in the beforeSend callback.


  var xmlHttpRequest = null;

  $.ajax({
  /* ... */
  beforeSend: function(request)
  {
  xmlHttpRequest = request;
  }
  });


  $.('button.canel').click(function(event)
  {
  if (null !== xmlHttpRequest) {
  xmlHttpRequest.abort();
  xmlHttpRequest = null;
  }
  event.preventDefault();
  });


  I am not sure if this would cause any issues with the overall ajax lifecycle. 
For example, if the cancel button was clicked, would the error callback be 
executed? I'll have to test it and see.

  --
  Hector



  On Tue, Aug 25, 2009 at 9:00 PM, rupak mandal rupakn...@gmail.com wrote:

Hi Hector,
you have to use abort function.

go through this link http://www.protofunc.com/scripts/jquery/ajaxManager/


Thanks
Rupak



On Wed, Aug 26, 2009 at 2:25 AM, Hector Virgen djvir...@gmail.com wrote:

  Hello,


  Is there a way to stop or cancel an ajax request on demand, similar to 
pressing stop in the browser? I would like to provide the user with a cancel 
button on a loading dialog that, when clicked, closes the dialog and cancels 
the ajax request. I have the dialog working (thanks to jQuery-UI) but pressing 
cancel only closes the it.


  I do not want simply ignore the response because I have a success 
callback that does some heavy manipulation of the response HTML that I'd like 
to prevent from running when the user cancels.


  Any help would be appreciated. Thanks!

  --
  Hector






[jQuery] Re: Asp.net AJAX form

2009-08-26 Thread Cesar Sanz
$.post.. or event better using the form plugin http://malsup.com/jquery/form/
  - Original Message - 
  From: k-one fathi 
  To: jquery-en@googlegroups.com 
  Sent: Wednesday, August 26, 2009 12:07 AM
  Subject: [jQuery] Re: Asp.net AJAX form


  I want to submit the form via AJAX ,in asp.net how I can do this?

  Thx



[jQuery] dump html

2009-08-26 Thread jhm

I'm pretty new to jquery and love it!  I was wondering if there was an
easy way to dump the html that gets generated after the page gets
loaded to verify it's what I wanted and expected (I'd like to check
out the source, not just the results).

Thanks!


[jQuery] Re: How to cancel an AJAX request?

2009-08-26 Thread Hector Virgen
I'm already using a number of plugins and don't want to add more overhead
for something as simple as calling a method on a native javascript object.

I was looking over the documentation for $.ajax and found this:

$.ajax() returns the XMLHttpRequest that it creates.


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

This should make it easier to call abort without the need of an extra
callback.

var xhr = $.ajax({
/* ... */
});

$.('button.cancel').click(function(event)
{
if (null !== xhr) {
xhr.abort();
xhr = null;
}
event.preventDefault();
});

--
Hector


On Wed, Aug 26, 2009 at 9:16 AM, Cesar Sanz the.email.tr...@gmail.comwrote:

  Why to re-invent the wheel?

 - Original Message -
 *From:* Hector Virgen djvir...@gmail.com
 *To:* jquery-en@googlegroups.com
 *Sent:* Wednesday, August 26, 2009 9:43 AM
 *Subject:* [jQuery] Re: How to cancel an AJAX request?

 Thanks, Rupak, but I was hoping to be able to accomplish this without a
 plugin. What I'm thinking of doing is storing the XMLHttpRequest object as a
 local variable early on, like in the beforeSend callback.
 var xmlHttpRequest = null;

 $.ajax({
 /* ... */
 beforeSend: function(request)
 {
 xmlHttpRequest = request;
 }
 });

 $.('button.canel').click(function(event)
 {
 if (null !== xmlHttpRequest) {
 xmlHttpRequest.abort();
 xmlHttpRequest = null;
 }
 event.preventDefault();
 });

 I am not sure if this would cause any issues with the overall ajax
 lifecycle. For example, if the cancel button was clicked, would the error
 callback be executed? I'll have to test it and see.

 --
 Hector


 On Tue, Aug 25, 2009 at 9:00 PM, rupak mandal rupakn...@gmail.com wrote:

 Hi Hector,
 you have to use abort function.

 go through this link http://www.protofunc.com/scripts/jquery/ajaxManager/


 Thanks
 Rupak


 On Wed, Aug 26, 2009 at 2:25 AM, Hector Virgen djvir...@gmail.comwrote:

 Hello,
 Is there a way to stop or cancel an ajax request on demand, similar to
 pressing stop in the browser? I would like to provide the user with a
 cancel button on a loading dialog that, when clicked, closes the dialog
 and cancels the ajax request. I have the dialog working (thanks to
 jQuery-UI) but pressing cancel only closes the it.

 I do not want simply ignore the response because I have a success
 callback that does some heavy manipulation of the response HTML that I'd
 like to prevent from running when the user cancels.

 Any help would be appreciated. Thanks!

 --
 Hector






[jQuery] Re: dump html

2009-08-26 Thread MorningZ

Use a tool like Firebug or Web Developer Toolbar to see what's going
on

On Aug 26, 11:03 am, jhm jmay...@gmail.com wrote:
 I'm pretty new to jquery and love it!  I was wondering if there was an
 easy way to dump the html that gets generated after the page gets
 loaded to verify it's what I wanted and expected (I'd like to check
 out the source, not just the results).

 Thanks!


[jQuery] Re: .load() doesn't work on first call in FF3 and IE (But works in FF3.5)?

2009-08-26 Thread Leonard Martin

Looks like a case of asynchronous-itis. You're reading the val() of
the load()-ed div before the Ajax call has had a chance to respond.

What you'll want to do is add the fancyBox stuff to the callback
function for load() like this:

$('div#resultsDataContainer').load('locatorResults.cfm',{'zip':$
('#branchLookup').val()},function(){

 $('#LocatorGoLink').fancybox({
'hideOnContentClick': false,
frameWidth: 660,
frameHeight: 700,
overlayOpacity: .6,
padding: 0
});

});

Or something similar anyway, I will confess I'm not too familiar with
FancyBox.

On Aug 26, 3:32 pm, D A dali...@gmail.com wrote:
 After a lot more testing, I think I know what's going on. I'm not sure
 if it's a jQuery issue or javascript in general.

 I've asked this on the FancyBox group, but thought I'd ask in here too
 as I have a hunch it's a more universal concept with jQuery that I
 need to grasp.

 What my script is doing:

  - calling .load() to populate a DIV with external content
  - calling fancyBox() to then display said DIV with content as a modal window.

 The end results is that I get a modal window that shows the contents
 of the div from the LAST .load()

 What I think happens is:

  1) jquery Loads content into div but does NOT render it yet.
  2) fancyBox grabs div but does NOT render it yet.
  3) jquery call ends so it then begins the rendering
  4) loaded content is displayed inside of DIV
  5) Fancy box displays the div as it was before render (ie, the
 original blank DIV).

 Is that a correct understanding? In otherwords, in any particular
 chain of events in jQuery, all events are performed and then they are
 all rendered, rather than going one-by-one through each event.

 If that is a correct understanding, any suggestions as to how to get
 the visual result that I want?

 -DA


[jQuery] Re: Variable in :eq() with jquery.calculation

2009-08-26 Thread betweenbrain

Hi Charlie,

Thanks for the response. Yes, I'm trying to loop it (and kind of new
to this). Some of the syntax was derived from examples I found online.

I'm away from that project at the moment but will give it a shot and
get back ASAP.

Thanks!

Matt

On Aug 25, 5:56 pm, Charlie charlie...@gmail.com wrote:
 I might be off base here but your recalc function code looks like you are 
 expecting a loop to occur through all of the $(input[name^=module-])
 I don't think this will occur without using $.each or a for loop therefore 
 you won't get any incrementation in i. Also I've never seen i=++, more 
 common syntax is i++ for incrementing i
 starting with something like :
 $(input[name^=module-]).each( function(i) {
        $(this).bind(keyup.
 will loop through each and add increment to i on each loop
 betweenbrain wrote:Hi All, I'm trying to use jquery.calculationto calculate 
 some text inputs versus a selected field. I'm running into an issue with 
 using variables to select information from the same row. Here's what I have 
 so far. Any help would be greatly appreciated: script 
 type=text/javascript $(document).ready( function (){ 
 $(input[name^=module-]).bind(keyup, recalc); 
 $(input[name='input-positions']).bind(click, recalc); recalc(); } ); 
 function recalc(){ var i = $(this)[0].rowIndex; 
 $([id=total-positions-left]).calc(avail - (used * qty), { avail: 
 $([name='input-positions']:checked).val(), used: 
 $([td.item-qty-pos-reqd'].eq(i)), qty: $(input[id^='module-qty'].eq(i)) 
 }), i = ++ $(#total-positions-left).text($this.sum() ); } /script


[jQuery] Re: Hover Area - Change image

2009-08-26 Thread Leonard Martin

You're not actually setting the source once you've replaced it:

$('li.clickable').hover(function() {
$(this).find('img').attr('src', $(this).find('img').attr
('src').replace(_off,_over));
}, function() {
   $(this).find('img').attr('src', $(this).find('img').attr
('src').replace(_over,_off));
});

It might be worth setting a variable to $('li.clickable').find('img')
as well since it's used 4 times in there, just to reduce overhead.



On Aug 26, 4:44 pm, wheatstraw psurr...@gmail.com wrote:
 OK! we're close...

 If I attach this to a variable and echo it out, it give's me the
 correct string. The _off is replaced with _over and the other way
 around. As I have it below, on hover, the image will not change, no
 errors (firebug), just doesn't do anything.

 $('li.clickable').hover(function() {
         $(this).find('img').attr('src').replace(_off,_over);}, function() 
 {

         $(this).find('img').attr('src').replace(_over,_off);

 });


[jQuery] Re: focus() killed by return false;

2009-08-26 Thread Cesar Sanz
how many inputs with .focus class do you have? more than one?
If so, you are trying to put focus to all of then, which is imposible..

@hector is right.
  - Original Message - 
  From: Hector Virgen 
  To: jquery-en@googlegroups.com 
  Sent: Wednesday, August 26, 2009 10:16 AM
  Subject: [jQuery] Re: focus() killed by return false;


  Try calling focus() on the actual element instead of the collection.


  Change this:
  $(input.focus).focus();


  To this:
  $(input.focus)[0].focus();

  --
  Hector



  On Wed, Aug 26, 2009 at 7:37 AM, shenry stuarthe...@gmail.com wrote:


*bump*

Any ideas?



[jQuery] Re: Hover Area - Change image

2009-08-26 Thread wheatstraw

OK! we're close...

If I attach this to a variable and echo it out, it give's me the
correct string. The _off is replaced with _over and the other way
around. As I have it below, on hover, the image will not change, no
errors (firebug), just doesn't do anything.

$('li.clickable').hover(function() {
$(this).find('img').attr('src').replace(_off,_over);
}, function() {
$(this).find('img').attr('src').replace(_over,_off);
});



[jQuery] Re: How to cancel an AJAX request?

2009-08-26 Thread Nick Fitzsimons

2009/8/26 Hector Virgen djvir...@gmail.com:
 Thanks, Rupak, but I was hoping to be able to accomplish this without a
 plugin. What I'm thinking of doing is storing the XMLHttpRequest object as a
 local variable early on, like in the beforeSend callback.

No need to make it so complex; from http://docs.jquery.com/Ajax/jQuery.ajax:

$.ajax() returns the XMLHttpRequest that it creates. In most cases
you won't need that object to manipulate directly, but it is available
if you need to abort the request manually.

So just do something like:

xhr = $.ajax(blah);

and when you want to abort the request, use

xhr.abort();

Regards,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


[jQuery] Re: Datepicker issue

2009-08-26 Thread Cesar Sanz


Hi,

Yo can always set the textfield readonly to avoid this.

- Original Message - 
From: MorningZ morni...@gmail.com

To: jQuery (English) jquery-en@googlegroups.com
Sent: Wednesday, August 26, 2009 7:29 AM
Subject: [jQuery] Re: Datepicker issue



to me it seems wierd or inconsistant that the
datepicker won't allow you to pick a date beyond the maxDate, but you
can enter it manually and nothing happens

Hence it's date picker and not date enter-er, it does it's job,
let's the use *pick* a date from a calendar


On Aug 26, 7:55 am, sak saks...@gmail.com wrote:

Yeah, I was wanting to avoid the need to write a function..or
freezing the textbox.to me it seems wierd or inconsistant that the
datepicker won't allow you to pick a date beyond the maxDate, but you
can enter it manually and nothing happens (it should revert back to
the maxDate)..

anyways all good, I guess I'll have to add that functionality myself..
Thanks though

On Aug 26, 11:47 am, rupak mandal rupakn...@gmail.com wrote:

 hi,
 you can try this

 $(#datepicker).change(function() {
 var date1=$(#datepicker).val();
 var myday = new Date(date1);
 var today= new Date();
 var one_day=1000*60*60*24;
 chan_date=Math.ceil((myday.getTime()-today.getTime())/(one_day));

 var month = myday.getMonth()+1;
 if(month10)
 month=0+month;

 var dat=myday.getDate();
 if(dat10)
 dat=0+dat;

 if(chan_date0)

 $(#datepicker).attr(value,month+/+dat+/+myday.getFullYear())
 });

 });

 but the better option is that restrict the user to enter date manually. 
 Made

 the datepicker text box readonly.

 Thanks
 Rupak

 On Wed, Aug 26, 2009 at 3:25 AM, sak saks...@gmail.com wrote:

  Hi there

  I have a problem with the date picker and was wondering if something
  had already been developed to sort it out, or whether I would need to
  do one myself.

  With a datepicker in the webapp we are developing, we want to allow
  users to view data based on past dates (ie anything from an old date
  up to present date). So with this in mind I have set the max date on
  the datepicker like this {maxDate: +0} so users can't pick dates
  beyond today.

  However if the user manually enters the dates (say beyond the maxDate)
  then nothing happens. The date input holds the date entered even if it
  is beyond the maxDate set.

  What I want it to do, is if the users manually types in a date (if
  that date is beyond the maxDate set) then it should revert back to the
  maxDate.

  can the datepicker do this?

  Any help will be awesome
  Thanks
  Sak 




[jQuery] Re: Hover Area - Change image

2009-08-26 Thread wheatstraw

That worked, thank you so much!

On Aug 26, 11:56 am, Leonard Martin leonard.mar...@gmail.com wrote:
 You're not actually setting the source once you've replaced it:

 $('li.clickable').hover(function() {
         $(this).find('img').attr('src', $(this).find('img').attr
 ('src').replace(_off,_over));}, function() {

        $(this).find('img').attr('src', $(this).find('img').attr
 ('src').replace(_over,_off));

 });

 It might be worth setting a variable to $('li.clickable').find('img')
 as well since it's used 4 times in there, just to reduce overhead.

 On Aug 26, 4:44 pm, wheatstraw psurr...@gmail.com wrote:

  OK! we're close...

  If I attach this to a variable and echo it out, it give's me the
  correct string. The _off is replaced with _over and the other way
  around. As I have it below, on hover, the image will not change, no
  errors (firebug), just doesn't do anything.

  $('li.clickable').hover(function() {
          $(this).find('img').attr('src').replace(_off,_over);}, 
  function() {

          $(this).find('img').attr('src').replace(_over,_off);

  });


[jQuery] Re: Hover Area - Change image

2009-08-26 Thread amuhlou

I think keeping the source in a variable is the key here, try this:

$('li.clickable').hover(function() {
var newsrc = $(this).find('img').attr('src').replace
(_off,_over);
$(this).find('img').attr({src: newsrc});
}, function() {
var oldsrc = $(this).find('img').attr('src').replace
(_over,_off);
$(this).find('img').attr({src: oldsrc});
});

On Aug 26, 3:44 pm, wheatstraw psurr...@gmail.com wrote:
 OK! we're close...

 If I attach this to a variable and echo it out, it give's me the
 correct string. The _off is replaced with _over and the other way
 around. As I have it below, on hover, the image will not change, no
 errors (firebug), just doesn't do anything.

 $('li.clickable').hover(function() {
         $(this).find('img').attr('src').replace(_off,_over);}, function() 
 {

         $(this).find('img').attr('src').replace(_over,_off);

 });


[jQuery] Re: Hover Area - Change image

2009-08-26 Thread Leonard Martin

Yes, you (wheatstraw) just need to remember that attr('src') returns a
string and *not* a reference to the src attribute.



On Aug 26, 5:16 pm, amuhlou amysch...@gmail.com wrote:
 I think keeping the source in a variable is the key here, try this:

 $('li.clickable').hover(function() {
         var newsrc = $(this).find('img').attr('src').replace
 (_off,_over);
         $(this).find('img').attr({src: newsrc});}, function() {

         var oldsrc = $(this).find('img').attr('src').replace
 (_over,_off);
         $(this).find('img').attr({src: oldsrc});

 });

 On Aug 26, 3:44 pm, wheatstraw psurr...@gmail.com wrote:

  OK! we're close...

  If I attach this to a variable and echo it out, it give's me the
  correct string. The _off is replaced with _over and the other way
  around. As I have it below, on hover, the image will not change, no
  errors (firebug), just doesn't do anything.

  $('li.clickable').hover(function() {
          $(this).find('img').attr('src').replace(_off,_over);}, 
  function() {

          $(this).find('img').attr('src').replace(_over,_off);

  });


[jQuery] Plug-in for elegant Horizontal Menu?

2009-08-26 Thread lukas

I stumbled over a very elegant way to select from a large item list on
http://siemens-home.com/  (Choose your country). Could anybody
direct me to a jquery plug-in? It would be great to replace my drop-
down menus with a more appealing menu. Thank you!


[jQuery] How to express the AND condition in jQuery

2009-08-26 Thread John

Hi,

If I like to find a div with children input, img, and span,
how to express the selector:

 the div that has children of an input tag, an img tag, and  a
span tag

in jQuery?

Seems the jQuery :has can do the job, but I am not really sure if
that is the correct way.
Any insight on this is appreciated.

Thanks in advance,

John


[jQuery] Re: .load() doesn't work on first call in FF3 and IE (But works in FF3.5)?

2009-08-26 Thread D A

 Looks like a case of asynchronous-itis. You're reading the val() of
 the load()-ed div before the Ajax call has had a chance to respond.

 What you'll want to do is add the fancyBox stuff to the callback
 function for load() like this:

 $('div#resultsDataContainer').load('locatorResults.cfm',{'zip':$
 ('#branchLookup').val()},function(){

             $('#LocatorGoLink').fancybox({
                        'hideOnContentClick': false,
                        frameWidth: 660,
                        frameHeight: 700,
                        overlayOpacity: .6,
                        padding: 0
            });

 });

Well, I came up with this:

$('#branchLocatorGoLink').click(function() {

$('div#resultsDataContainer').load('locatorResults.cfm',{'zip':$('#branchLookup').val()},function(){
$('#branchLocatorGoLink').fancybox({
   'hideOnContentClick': false,
   frameWidth: 660,
   frameHeight: 700,
   overlayOpacity: .6,
   padding: 0
});
 });
});

The problem is that fancybox (for lack of proper terminology) has to
attach itself to the link as a click event BEFORE I actually click the
object, so setting it up from a click event won't actually trigger the
fancy box.

For now, the solution was to forgo any modal box that moves things
around in the DOM (as it appears FancyBox and ThickBox do) and instead
am loading it into a div and changing the visuals via CSS only. That
seems to work fine.

The problem seems to arise when I both try and load something into the
DOM node via ajax AND move the DOM node as it seems to be
moving/cloning the node before it's being populated with from the ajax
call.

All that said, this doesn't seem to be THAT unusual of a combination
of events so I hope someone has done something similar and knows the
fix/workaround... ;)

-DA


[jQuery] Re: How to express the AND condition in jQuery

2009-08-26 Thread John

Thanks, will try.

Does that mean that the :has operator is not designed for the AND
operation?

Thanks,

John

On Aug 26, 12:52 pm, MorningZ morni...@gmail.com wrote:
 Not sure if this is the only or best way or how fast it may or may
 not be, but does work

 http://paste.pocoo.org/show/136392/

 On Aug 26, 12:32 pm, John jian.fang.subscr...@gmail.com wrote:

  Hi,

  If I like to find a div with children input, img, and span,
  how to express the selector:

   the div that has children of an input tag, an img tag, and  a
  span tag

  in jQuery?

  Seems the jQuery :has can do the job, but I am not really sure if
  that is the correct way.
  Any insight on this is appreciated.

  Thanks in advance,

  John


[jQuery] Re: IE Superfish z-indexing problem

2009-08-26 Thread mr.amazing

Thanks for your quick resonse!

I tried that and it messed up the position of the menu and it didnt
fix the z-index. if i gave you ftp access to the css files could you
try to play with it? just give me your email address and i will send
you the username/password.

On Aug 26, 9:35 am, rupak mandal rupakn...@gmail.com wrote:
 Hi,
 This problem is due to position relative in sf-menu ul class . If you
 change the position to absolute i think it will work.

 thanks
 Rupak

 On Wed, Aug 26, 2009 at 5:17 AM, mr.amazing kenanrahm...@gmail.com wrote:

  I know, I know, this is a common problem. Well, after trying every
  combination of z-index values for all elements on my page, I decided
  to consult an expert on the matter, The problem can be seen here:

 http://traceurl.com/go/917/demo

  I have the RokSlideshow module installed, as you can see. I modified
  the js for the slideshow to stop the increasing z-index on images with
  no luck. I set the z-index to the items in the menu to 100 and
  still got nothing. Please help!

  Thanks,
  mr.amazing


[jQuery] Re: [autocomplete] how to clear hidden key field when user changes text value?

2009-08-26 Thread Dac

Thanks Jörn!

It took me a minute to realize that .autocomplete should reference
my text input control (and not an autocomplete generated object), and
that .search() is an autocomplete function. But otherwise, it did the
trick.

Darren


On Aug 20, 2:39 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 You could try this, similar to what the plugin does for the mustMatch option:

 $(.autocomplete).blur(function() {
  $(this).search(function(result) {
    if (!result) {
      // no match found, do something, eg. clearing other fields
    }
  });

 });

 Jörn

 On Thu, Aug 13, 2009 at 5:25 PM, Billybilly.swee...@gmail.com wrote:

  Hi all,
  I'm usingautocompleteplugin, when the user types something the
  backend responds value and key information (for instance:

  John|76178
  Mike|87252
  Peter|87511

  Using .result I'm setting the key in a hidden field in my form.

  $('#autocompleteTextboxId').result(function(event, data, formatted) {
         if (data)
                 $('#autocompleteHiddenValueId').val(data[1]);
  });

  But what if the user changes his mind and after choosing John types
  something else in the textbox (without actually chosing a new option
  from theautocompleteoptions) or even deletes the whole text? As
  things are now, the data previously set in the hidden field remains
  there. So the user might post the form thinking that his selection is
  blank, but the system actually thinks that he selected 76178.

  Is there a way to clear the hidden field when the user types
  something?

  I tried by setting some action to focus so that whenever the user
  focuses on the textbox the hidden value is cleared but it seems that
  after the user chooses a value in theautocompleteoptions, the plugin
  sets focus to the text field (hence making this action execute, thus
  clearing the hidden value everytime).

  $('#autocompleteTextboxId').focus(function() {
         $('#autocompleteHiddenValueId').val('');
  });

  It would be cool if we had something like .textChanged (similar to
  .result above) where we can do some action when the user changes the
  text on the field.

  Maybe some of the JS wizards here can suggest something.

  Thanks.


[jQuery] Re: dump html

2009-08-26 Thread jhm

Thanks! I do use Firebug, but never look at the html tab. That was
just what I was looking for!


On Aug 26, 8:20 am, MorningZ morni...@gmail.com wrote:
 Use a tool like Firebug or Web Developer Toolbar to see what's going
 on

 On Aug 26, 11:03 am, jhm jmay...@gmail.com wrote:

  I'm pretty new to jquery and love it!  I was wondering if there was an
  easy way to dump the html that gets generated after the page gets
  loaded to verify it's what I wanted and expected (I'd like to check
  out the source, not just the results).

  Thanks!


[jQuery] Re: empty() is very slow

2009-08-26 Thread James

I've found something that worked a faster to empty something when I
tested it.

function replaceHtml(el, html) {
var oldEl = typeof el === string ? document.getElementById(el) :
el;
if (oldEl == null) return null;
var newEl = oldEl.cloneNode(false);
newEl.innerHTML = html;
oldEl.parentNode.replaceChild(newEl, oldEl);
return newEl;
};

replaceHtml(Container_Id, '');


On Aug 26, 8:54 am, MorningZ morni...@gmail.com wrote:
 What is jQuery doing to empty an element?

 That's so easy to see/find-out for yourself

 open up the jquery.js file, search for emtpy and voila

  empty: function() {
             // Remove element nodes and prevent memory leaks
             jQuery(this).children().remove();

             // Remove any remaining nodes
             while (this.firstChild)
                 this.removeChild(this.firstChild);
         }

 2. Are there any rules when not to use jQuery for certain DOM tasks
 but better to resort to direct DOM manipulation as in the example
 above? 

 One option that I've seen recommended a lot is to set the .innerHTML
 of the DOM object to empty string.  i remember that it's fast, but
 I can't remember if there were downsides to using that instead

 On Aug 26, 2:32 pm, oleOhle mohleme...@googlemail.com wrote:

  While writing my first jQuery application I encountered a performance
  issue whichs casts doubts on the suitability of jQuery for my purposes
  in general.

  The issue: In my page I have a dynamically filled div which in the
  end contains about 10 elements, one of which is a table with 1000
  rows. Now when I try to clear that div with a simple function like

  function clearContainer() {
      $('#' + Container_ID).empty();

  }

  this will take forever, i.e. one faster machine  a few seconds, on my
  netbook it even leads to javascript timeout errors.

  Rewriting the function to

  function clearContainer() {
      var containerNode = document.getElementById(Container_ID);
      while(containerNode.hasChildNodes()) {
          containerNode.removeChild(containerNode.lastChild);
      }

  }

  fixes the perfomance issue, the div is cleared almost immediately.

  Two questions remain:
  1. How can the results be explained? What is jQuery doing to empty an
  element?
  2. Are there any rules when not to use jQuery for certain DOM tasks
  but better to resort to direct DOM manipulation as in the example
  above?




[jQuery] Re: Get the input value of ANY element p tag

2009-08-26 Thread ArySal

Thanks for the help what I did was change it completely you are right
it is a simple process.
Code:
$(document).ready(function() {

$('.my_property').click(function () {

var prop =$(this).attr(name);


$.post(n10-shortlist-connector.html, { web_AGENT_REF: prop});
var htmlStr = Added to Compare Tool;
$(this).text(htmlStr);
$(this).attr(style,color: #666);


});

   });




a class=my_property style=cursor:pointer; color: #900 name=?
echo $AGENT_REF; ?Add to compare list/a
Thanks again for all your help, much appreciated

On Aug 25, 8:09 pm, ArySal aresh...@gmail.com wrote:
 thank you Paolo I will also try this,

 On Aug 25, 7:12 pm, Paolo Chiodi chiod...@gmail.com wrote:



  Another way is to alert($(this).find(#property_links).size()) to see
  how many dom elements you get with that selector

  Have you tried to use firebug to see the value of the hidden inputs?
  maybe also that the error was server side...

  Paolo

  On Tue, Aug 25, 2009 at 8:09 PM, Paolo Chiodichiod...@gmail.com wrote:
   What kind of error have you now? Have you tried to do alert(prop) to
   see if the value is correct?

   Paolo

   On Tue, Aug 25, 2009 at 5:49 PM, ArySalaresh...@gmail.com wrote:

   Hi Paolo,

   Thanks for the advice.

   I tried what you mentioned still it does not work, the error is
   slightly different but the result is pretty much the same.

   What do you mean By the way, it is not reccomanded to have more then
   one element with same id , could you recommend a tutorial or pointers
   where I can get this function working please

   Thanks Ary


[jQuery] Re: trouble with 'url' in $.ajax

2009-08-26 Thread ch2450


Thank you to both of you.
It worked when I use the url beginning with a slash.
Thanks for your time.


[jQuery] Re: Form Plugin issue

2009-08-26 Thread Mike Alsup

 It looks like the problem is that the form is submitted into generated
 Iframe, which doesn't have references to jquery or other JS libraries
 that you might be using.

Kostya is correct.  Try embedding the response in a textarea element -
the plugin will automatically extract if for you and no escaping is
needed.

Mike


[jQuery] Re: binding events to dynamically created divs

2009-08-26 Thread James

You should read this for more info:
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F
Although you're not using AJAX to introduce the content into the DOM,
it's still similar to what you're doing.

On Aug 26, 7:35 am, batterhead batterh...@gmail.com wrote:
 Hi All,

 I have a page with a div that contains other divs. In the outer div, I
 have links that add new divs inside. I also have a link outside the
 outer div that adds more of those outer divs to the page (with an
 inner div, and the same links to add more). This works on the div that
 is hard coded on the page, but when I use the link to add additional
 container divs the links inside there to add more inner divs does not
 function. I believe it has to do with binding, but I'm not certain how
 to fix this issue. Any assistance would be appreciated.

 Here is my code:

 $(document).ready(function() {

         $(.AddDisc).click( function() {
                 discContainerDiv = div class='discContainer'div
 class='trackContainer'input type='text' class='trackInput' //
 divdiv class='trackControls'a href='#' class='AddTrack'(++)/a
 a href='#' class='RemoveTrack'(--)/a/div/div;
                 var $newDiv = 
 $('.discContainer:last').after(discContainerDiv);
                 alert($newDiv.html);
                 return false;
         });

         $(.RemoveDisc).click( function() {
                 $('.discContainer:last').remove();
                 return false;
         });

         $(.AddTrack).click( function() {
                 trackContainerDiv = div class='trackContainer'input 
 type='text'
 class='trackInput' value='dynamic div' //div;
                 
 $(this).parent().parent().end().prev().after(trackContainerDiv);
                 return false;
         });

         $(.RemoveTrack).click( function() {
                 $(this).parent().parents(.trackDiv).end().prev().remove();
                 return false;
         });

 });

 And the HTML:

 div class='discContainer'
 div class='trackContainer'
 input type='text' class='trackInput' /
 /div

 div class='trackControls'
 a href='#' class='AddTrack'(++)/a
 a href='#' class='RemoveTrack'(--)/a
 /div
 /div
 hr /
 a href=# class=AddDisc(++)/a
 a href=# class=RemoveDisc(--)/a


[jQuery] Re: jQuery Form Plugin ajax submit

2009-08-26 Thread Mike Alsup

 Using the following code:

 $('.input_all').attr(disabled, disabled);

 for input texts with the class=input_all seems to break jQuery forms
 ajax submit.

 How can I fix this?


If you are expecting disabled inputs to be submitted then that is not
really broken - disabled inputs should *not* be submitted (per the
HTML spec).  If you really don't want to adhere to the spec and you
want all inputs to be submitted, regardless of whether or not they are
successful[1], then you can change line 423 of the plugin to this:

var v = $.fieldValue(el, false);

[1] http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2


[jQuery] Re: App like hangman

2009-08-26 Thread Boris Trivic

Well, maybe you don't understand whats the problem, so here is
screenshot:

Do you think it's the bug or my mistake?


[jQuery] Re: Image inside script

2009-08-26 Thread Paolo Chiodi

$(.+errId).prepend('img  /');

On Wed, Aug 26, 2009 at 5:45 AM, Fabiofabioisc...@gmail.com wrote:
 $(.+errId)


[jQuery] Re: using cycle plugin like serialscroll

2009-08-26 Thread Mike Alsup

 i want to use the cycle plugin to replace the serialscroll plugin i'm
 using to do horizantal scroll? how would i do that? what would i have
 to change in the css and options? i tried some different things but
 can't get it to show more than one item at a time.

Group your images inside divs.


[jQuery] Re: Cycle plugin: problem showing slide titles in pager (using pagerAnchorBuilder function)

2009-08-26 Thread Mike Alsup

 This question has been asked several times in various places online,
 but the solution that's usually given isn't working for me.

 I want to show the slide titles (rather than just numbers) in the
 pager, so am calling it like this:

 jQuery(document).ready(function() {
         jQuery('#cycle-pics').cycle({
                 speed:1000,
                 timeout:3000,
                 next:'#next',
                 prev:'#prev',
                 pager:'#cycle-numbers',
                 pagerAnchorBuilder: function(idx, slide) {
                         return 'a href=#'+(idx+1)+' '+ slide.title 
 +'/a';
                 }
         });
 });

 The pagerAnchorBuilder function is correctly showing the slide
 numbers, but not the titles.


Try this:

pagerAnchorBuilder: function(idx, slide) {
var txt = '' + (idx+1) + ' ' + $(slide).attr('title');
return 'a href=#'+ text +'/a';
}


[jQuery] Re: focus() killed by return false;

2009-08-26 Thread shenry

I've only got one element with .focus at this point, but I'll try
Hector's suggestion this evening.

Thanks for the help


[jQuery] Re: Trying to use blockUI from within an iframe to block the parent iframe

2009-08-26 Thread Mike Alsup

 I am loading a collection of frames as follows (from jsp source, so
 ignore %= % blocks):

 html
     frameset name=MNGM_OUTER rows=50,*,20 framespacing=0
 frameborder=0 border=0
         frame name=MNGM_TOP src=control/top.jsp scrolling=no
 noresize scrolling=no/
         frameset id=MNGM_INNER name=MNGM_INNER cols=170,*
 framespacing=0 frameborder=0 border=0
             frame name=MNGM_NAVIGATION src=%=navpage%
 scrolling=no noresize/
             frame name=MNGM_WORKINGAREA src=%=workpage%
 noresize/
         /frameset
         frame name=MNGM_FOOT src=control/footer.jsp scrolling=no
 noresize scrolling=no/
     /frameset
 /html

 I have jquery and blockUI loading from the frame MNGM_WORKINGAREA. I
 would like to use blockUI to block the entire page from the frame
 MNGM_INNER down.  I have constructed my call to blockUI as follows:

 function foo() {
     $(document).ready(function() {
         $.blockUI({
             css: {
                 backgroundColor: 'F00',
                 color: '#000'
             },
             applyPlatformOpacityRules: false,
             message: img src='../../images/busy.gif' / Please
 wait ...,
             opacity: '0.5'
         });
     });

 This will successfully block the current document which is
 MNGM_WORKINGAREA.  How can I call this function correctly such that it
 will block the parent of this document?


Assuming the parent doc has jQuery and the blockUI plugin loaded:

window.parent.$.blockUI(...);


[jQuery] Re: how to know script's self path?

2009-08-26 Thread tinker

Hi there,

I wish to get the path and filename of the current running js file  
itself. I thought there must be the similar way just like php's  
$_SERVER['PHP_SELF'] does but I cannot find any clue. As you know,  
'location' returns path and filename of html file not js file. Anyone  
knows how to do that? I have been stuck by this question for weeks. I  
wait for good answer. Thank you.


Tink






[jQuery] Re: empty() is very slow

2009-08-26 Thread Josh Powell

.empty and .html looks in every node that it removes/replaces and
checks for and removes event bindings in order to prevent memory
leaks.  If you know you do not have bound events, first use plain old
javascript to set element.innerHTML = ''; and then remove/replace the
element using .empty()/.html()  Though in the case of .empty it could
be redundant.

On Aug 26, 12:01 pm, James james.gp@gmail.com wrote:
 I've found something that worked a faster to empty something when I
 tested it.

 function replaceHtml(el, html) {
         var oldEl = typeof el === string ? document.getElementById(el) :
 el;
         if (oldEl == null) return null;
         var newEl = oldEl.cloneNode(false);
         newEl.innerHTML = html;
         oldEl.parentNode.replaceChild(newEl, oldEl);
         return newEl;

 };

 replaceHtml(Container_Id, '');

 On Aug 26, 8:54 am, MorningZ morni...@gmail.com wrote:

  What is jQuery doing to empty an element?

  That's so easy to see/find-out for yourself

  open up the jquery.js file, search for emtpy and voila

   empty: function() {
              // Remove element nodes and prevent memory leaks
              jQuery(this).children().remove();

              // Remove any remaining nodes
              while (this.firstChild)
                  this.removeChild(this.firstChild);
          }

  2. Are there any rules when not to use jQuery for certain DOM tasks
  but better to resort to direct DOM manipulation as in the example
  above? 

  One option that I've seen recommended a lot is to set the .innerHTML
  of the DOM object to empty string.  i remember that it's fast, but
  I can't remember if there were downsides to using that instead

  On Aug 26, 2:32 pm, oleOhle mohleme...@googlemail.com wrote:

   While writing my first jQuery application I encountered a performance
   issue whichs casts doubts on the suitability of jQuery for my purposes
   in general.

   The issue: In my page I have a dynamically filled div which in the
   end contains about 10 elements, one of which is a table with 1000
   rows. Now when I try to clear that div with a simple function like

   function clearContainer() {
       $('#' + Container_ID).empty();

   }

   this will take forever, i.e. one faster machine  a few seconds, on my
   netbook it even leads to javascript timeout errors.

   Rewriting the function to

   function clearContainer() {
       var containerNode = document.getElementById(Container_ID);
       while(containerNode.hasChildNodes()) {
           containerNode.removeChild(containerNode.lastChild);
       }

   }

   fixes the perfomance issue, the div is cleared almost immediately.

   Two questions remain:
   1. How can the results be explained? What is jQuery doing to empty an
   element?
   2. Are there any rules when not to use jQuery for certain DOM tasks
   but better to resort to direct DOM manipulation as in the example
   above?


[jQuery] Re: syntax problems

2009-08-26 Thread MorningZ

If you are using 1.3.2 of the library, then lose the @

is there any reason why you just don't say

jQuery(a#myLink)

since you can't use $ ?


On Aug 26, 11:40 am, holicGirl mirna.bagnola...@gmail.com wrote:
 Hello,
 I have a basic knowlegde of jQuery and a problem in selecting a link.
 To be specific I've a problem with the syntax.

 I'm using several libraries so I can't use for example the $
 ('a#myLink') function but I've to write jq('a...@id=myLink]').

 The application don't recognize the syntax, it shows this message:
          Syntax error, unrecognized expression: [...@id=myLink]

 Can someone help me?

 Thanks in advance


[jQuery] Re: jQuery.sortable with block containing javascript

2009-08-26 Thread Benoit toutant
Done, thanks for help :)

2009/8/26 Richard D. Worth rdwo...@gmail.com

 Could you create a test page and attach to a new ticket here?
 http://dev.jqueryui.com/newticket (note: requires registration)

 Thanks.

 - Richard

 On Wed, Aug 26, 2009 at 2:47 AM, B3nitro b3ni...@gmail.com wrote:


 Hi,

 I'm new with jQuery and javascript framework in general, I've a
 little problem with the the sortable plugin.

 The code of my page looks like this  :
 html
 body
 div id=container
 !-- Some divs --
 div class=menuNormal content/div
 !-- Bugs is here... --
 div class=comment
  div class=datescript type=text/
 javascriptdocument.write(date('d/m/Y à g:i a',1251265362));/
 script/div
  div class=contentSome text/div
 /div
 !-- ... --
 div class=footerNormal content/div
 /div
 /body
 script type=text/javascript
 $(document).ready(function()
 {
 $(#container).sortable({ cursor: 'crosshair', containment: 'parent',
 opacity: 0.6, scroll: true });
 });
 /script
 /html

 All div class=comment make crash the browser on dropping them (drag
 work), others div's like menu and footer works well.

 Do you have an idea to make div with js inside sortable ?

 Thanks in advance :)





[jQuery] Re: Cycle Plugin - Different Transition Effects for Pager and Auto-Advance?

2009-08-26 Thread Mike Alsup

 Is it possible to use enable different transition effects for auto-
 advance versus the pager (that is, when a user clicks a pager item)?

 I'd like very much to use fade as images auto-advance without user
 input, but use a more advanced easing effect if the user clicks an
 item in the pager.


Not currently supported.


[jQuery] empty() is very slow

2009-08-26 Thread oleOhle

While writing my first jQuery application I encountered a performance
issue whichs casts doubts on the suitability of jQuery for my purposes
in general.

The issue: In my page I have a dynamically filled div which in the
end contains about 10 elements, one of which is a table with 1000
rows. Now when I try to clear that div with a simple function like

function clearContainer() {
$('#' + Container_ID).empty();
}

this will take forever, i.e. one faster machine  a few seconds, on my
netbook it even leads to javascript timeout errors.

Rewriting the function to

function clearContainer() {
var containerNode = document.getElementById(Container_ID);
while(containerNode.hasChildNodes()) {
containerNode.removeChild(containerNode.lastChild);
}
}

fixes the perfomance issue, the div is cleared almost immediately.

Two questions remain:
1. How can the results be explained? What is jQuery doing to empty an
element?
2. Are there any rules when not to use jQuery for certain DOM tasks
but better to resort to direct DOM manipulation as in the example
above?




[jQuery] syntax problems

2009-08-26 Thread holicGirl

Hello,
I have a basic knowlegde of jQuery and a problem in selecting a link.
To be specific I've a problem with the syntax.

I'm using several libraries so I can't use for example the $
('a#myLink') function but I've to write jq('a...@id=myLink]').

The application don't recognize the syntax, it shows this message:
 Syntax error, unrecognized expression: [...@id=myLink]

Can someone help me?

Thanks in advance


[jQuery] Re: syntax problems

2009-08-26 Thread Michael Lawson
If you are using the most recent version of jQuery, the @ notation is no
longer used.  Try removing it and see what happens.

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'



 
  From:   holicGirl mirna.bagnola...@gmail.com
 

 
  To: jQuery (English) jquery-en@googlegroups.com   
 

 
  Date:   08/26/2009 04:20 PM   
 

 
  Subject:[jQuery] syntax problems  
 

 






Hello,
I have a basic knowlegde of jQuery and a problem in selecting a link.
To be specific I've a problem with the syntax.

I'm using several libraries so I can't use for example the $
('a#myLink') function but I've to write jq('a...@id=myLink]').

The application don't recognize the syntax, it shows this message:
 Syntax error, unrecognized expression: [...@id=myLink]

Can someone help me?

Thanks in advance

inline: graycol.gifinline: ecblank.gif

[jQuery] slide one div out left while sliding one in right

2009-08-26 Thread W. Young

I have a container div with two inner divs.  I have one inner div
visible taking up 100% of the visible area and another hidden div.  I
want the visible div to slide to the left while simultaneously sliding
the other div in from the right.  This works fine except that while
the right div is sliding in, it appears below the left div.

How can this be done?

Here is the code:

script type=text/javascript src=js/jQuery/jquery.js/script
script type=text/javascript src=js/jQuery/effects.core.js/
script
script type=text/javascript src=js/jQuery/effects.slide.js/
script

script type=text/javascript
$(document).ready(function() {
$(#slide).click(function() {
$(#leftDiv).hide('slide', { direction: 'left' }, 
1000);
$(#rightDiv).show('slide', { direction: 'right' }, 
1000);
return false;
});
});
/script

div id=container style=height: 100px; 
div id=leftDiv style=float: left; border: solid 1px black;
height: 100px; width: 100%;
spansome text to slide out left/span
/div
div id=rightDiv style=float: left; display: none; border: solid
1px black; height: 100px; width: 100%;
spansome text to slide in right/span
/div
/div
div style=clear: both; height: 100px;
input id=slide type=button value=Slide /
/div


[jQuery] Re: How to express the AND condition in jQuery

2009-08-26 Thread John

Cool. It works. Thanks again.

I am a beginner of jQuery and need further help on this. Practically,
I will have variable number of inputs to do the and operation. That is
to say, I need to pass in an array to the myselector plugin apart from
the object, how to achieve that?

Thanks in advance,

John

On Aug 26, 1:25 pm, John jian.fang.subscr...@gmail.com wrote:
 Thanks, will try.

 Does that mean that the :has operator is not designed for the AND
 operation?

 Thanks,

 John

 On Aug 26, 12:52 pm, MorningZ morni...@gmail.com wrote:

  Not sure if this is the only or best way or how fast it may or may
  not be, but does work

 http://paste.pocoo.org/show/136392/

  On Aug 26, 12:32 pm, John jian.fang.subscr...@gmail.com wrote:

   Hi,

   If I like to find a div with children input, img, and span,
   how to express the selector:

    the div that has children of an input tag, an img tag, and  a
   span tag

   in jQuery?

   Seems the jQuery :has can do the job, but I am not really sure if
   that is the correct way.
   Any insight on this is appreciated.

   Thanks in advance,

   John


[jQuery] Re: not able to append new tag in XML in IE

2009-08-26 Thread Paolo Chiodi

Maybe not the best solution, but here's something that work:

var new_element = xmlData.get(0).createElement('new_element_name');
xmlData.find('your_query').append(new_element);

On Wed, Aug 26, 2009 at 1:49 PM, g...@iecabhi.pur...@gmail.com wrote:

 In ajax call, i set dataType as 'xml' and on success, i call a
 function in which i am passing xml which i got as response.
 And in the function i a assigning  that data to a global variable so
 that i can access it from any function.
 I am assigning it to a global variable as shown below :
 xyz : function(data){
  xmlData = $(data);
  .
 
 }
 like this and then i need to modify xmldata if there is any change in
 form and on submit of form, i am sending xmlData back to server using
 ajax call.

 So please guide me accordingly to modify xml in global variable on
 change in form data from any other function.

 On Aug 26, 3:47 pm, Paolo Chiodi chiod...@gmail.com wrote:
 You don't have to use xmlData, which is the jquery object, but data
 which is the xml dom (if you set xml as type of the request)

 Paolo

 On Wed, Aug 26, 2009 at 12:35 PM, g...@iecabhi.pur...@gmail.com wrote:

  Thanks for your reply.
  But this is not working.The data which i got as a result from ajax
  call on success, i stored it in a global variable.
  Like this
  var xmlData = $(data);
  But when i was executing like you told, it is not creating an
  element.

  On Aug 26, 1:49 pm, Paolo Chiodi chiod...@gmail.com wrote:
  when you do document.createElement you create an element that is child
  of document document.
  Try to create the element with data.createElement.

  Paolo

  On Wed, Aug 26, 2009 at 10:14 AM, g...@iecabhi.pur...@gmail.com wrote:

   I am making an ajax call and in response, i am getting an XML.
   And then using data from XML, i am creating a form.
   I stored response XMl in a variable like this
    var xmlData  = $(data);
   If there is any change in any field of  form then i am changing
   corresponding node value in xmlData
   by appending new node in related node like this :
    var val = document.createElement('{nodename}');
   $(val).text({changed value});
   $({corresponding node}).append($(val));

   This is working fine in FF but not working in IE.

   Kindly guide me how can i solve this problem.

   Thanks in advance to all for providing guidance.


[jQuery] Re: how to get back the DOM element as HTML source

2009-08-26 Thread John

Cool. Thanks.  -John

On Aug 21, 9:49 am, KeeganWatkins mkeeganwatk...@gmail.com wrote:
 i wrote a really simple plugin for this, as i frequently have the same
 use case:

 jQuery.fn.outerHTML = function() {
     return jQuery(div/).append( jQuery(this[0]).clone() ).html();

 }

 so that i could call it on any element, such as:

 $(#fooID).outerHTML();

 On Aug 19, 9:55 am,Johnjian.fang.subscr...@gmail.com wrote:

  That works. Really appreciate your help. -John

  On Aug 18, 7:48 pm, mkmanning michaell...@gmail.com wrote:

   outerHTML is an IE addition to the DOM and not supported by Firefox.
   If you want to get it with jQuery just append the element to a div and
   get itshtml():

   $('div').append( $(table:first).clone() ).html()

   On Aug 18, 4:37 pm, Jules jwira...@gmail.com wrote:

Use DHTML property.

$(table:first)[0].outerHTML

On Aug 19, 12:36 am,Johnjian.fang.subscr...@gmail.com wrote:

 Thanks, Anurag. Let me rephrase my question. For example, I can use
 the following jQuery
 to get thehtmlsourceof a table element

 $(table:first).html()

 The returnedhtmlsourcedoes not include the table itself, I like to
 see thehtmlsourcestarting
 from the table, for example,

 table class=aaa
 ..
 /table

 Is there any jQuery function for this? If not, how do I implement
 this?

 Thanks in advance,

John
 On Aug 18, 2:06 am, anurag pal mail.anurag@gmail.com wrote:

  HiJohn,

  After setting thehtmlby usinghtmlmethod you have to bind the DOM
  elements using bind method.

  Example:
  script type=text/javascript
      $(.pge).bind(click, function(e){
          var options = {};
            $.ajax({
                      url: data_retrieval.php,
                      cache: false,
                      type: GET,
                        data: ({id : this.getAttribute('id')}),

                      success: function(html){
                          $(#slacker_detail_view).html(html);
                          $('#slacker_detail_view').show('blind', 
  options,
  1500);
                      }
                  });
          });
  /script

  Regards,
  Anurag Pal

  On Tue, Aug 18, 2009 at 7:40 AM,Johnjian.fang.subscr...@gmail.com 
  wrote:

   Hi,

   How do I get back the DOM element asHTMLsourceusing jQuery? 
   Thehtml
   () method only returns the innerHTML and it does not include the 
   UI
   element itself. But I am more interested in converting the UI 
   element
   itself toHTML.

   Thanks in advance,

   Jian


[jQuery] Re: how to multiple images slideshow with jquery cycle plugin

2009-08-26 Thread Mike Alsup

 I'm looking for a same kind of solution.
 Sliding rows of 3 images at the same time.
 9 visible images in 3 rows (1-3) (4-6) (7-9).
 Next slide will hide (1-3) and who (10-12).

 Anyone know how to do that?



The way to do that with Cycle is to group the sets of images inside
divs and treat the divs as slides.  For example:

div id=slideshow
div
img  /
img  /
img  /
/div
div
img  /
img  /
img  /
/div
div
img  /
img  /
img  /
/div
/div


[jQuery] Re: empty() is very slow

2009-08-26 Thread MorningZ

What is jQuery doing to empty an element?

That's so easy to see/find-out for yourself

open up the jquery.js file, search for emtpy and voila

 empty: function() {
// Remove element nodes and prevent memory leaks
jQuery(this).children().remove();

// Remove any remaining nodes
while (this.firstChild)
this.removeChild(this.firstChild);
}


2. Are there any rules when not to use jQuery for certain DOM tasks
but better to resort to direct DOM manipulation as in the example
above? 

One option that I've seen recommended a lot is to set the .innerHTML
of the DOM object to empty string.  i remember that it's fast, but
I can't remember if there were downsides to using that instead



On Aug 26, 2:32 pm, oleOhle mohleme...@googlemail.com wrote:
 While writing my first jQuery application I encountered a performance
 issue whichs casts doubts on the suitability of jQuery for my purposes
 in general.

 The issue: In my page I have a dynamically filled div which in the
 end contains about 10 elements, one of which is a table with 1000
 rows. Now when I try to clear that div with a simple function like

 function clearContainer() {
     $('#' + Container_ID).empty();

 }

 this will take forever, i.e. one faster machine  a few seconds, on my
 netbook it even leads to javascript timeout errors.

 Rewriting the function to

 function clearContainer() {
     var containerNode = document.getElementById(Container_ID);
     while(containerNode.hasChildNodes()) {
         containerNode.removeChild(containerNode.lastChild);
     }

 }

 fixes the perfomance issue, the div is cleared almost immediately.

 Two questions remain:
 1. How can the results be explained? What is jQuery doing to empty an
 element?
 2. Are there any rules when not to use jQuery for certain DOM tasks
 but better to resort to direct DOM manipulation as in the example
 above?


[jQuery] Re: App like hangman

2009-08-26 Thread Boris Trivic

http://caraudio-rs.info/snapshot1.png

On Aug 26, 8:15 pm, Boris Trivic trivu...@gmail.com wrote:
 Well, maybe you don't understand whats the problem, so here is
 screenshot:

 Do you think it's the bug or my mistake?


[jQuery] Re: App like hangman

2009-08-26 Thread Boris Trivic

Well, maybe you don't understand whats the problem, so here is
screenshot:

http://caraudio-rs.info/snapshot1.png

Do you think it's the bug or my mistake?


On Aug 25, 1:08 pm, Boris Trivic trivu...@gmail.com wrote:
 omg!
 I just opened it in Opera (Linux) and there is some kind of bug or
 what? Instead revert to original location, chars returns about
 100-150px right... Can someone take a look and check if same problem
 occurs?

 Maybe I shoult report it to jQuery dev team?

 On Aug 25, 7:00 pm, Boris Trivic trivu...@gmail.com wrote:

  Yeah, sure, it imposible to convert object to string, object has
  methods and properties for that what I want.
  Wheathever, thanks a lot Brett one more time, you saved me.

  I finished a main part of project, there is still some little stufs to
  fix and correct. You can take a look on next link, if you want:

 http://caraudio-rs.info/nal_7/

  On Aug 25, 12:17 am, Brett Ritter swift...@swiftone.org wrote:

   On Mon, Aug 24, 2009 at 11:24 AM, Boris Trivictrivu...@gmail.com wrote:
I can success print ui.draggable to console, but how to convert it to
string?
I need to write it into some element with .innerHTML and I will
probably use it in for loop...

   I think you are trying the hard way.

   ui.draggable is not a string, but a jQuery element.  Use that as you see 
   fit.

   For Hangman you're probably looking to copy either the text  (
   ui.draggable.text() ) or the html itself ( ui.draggable.html() ).  If
   you need to clone the source you want ui.draggable.clone() (note that
   any events bound to the original are not bound to the clone unless you
   use live() )

   Trying to convert a jQuery element to a string doesn't make sense
   unless you say what string you want - the text, the html, the id,
   these are all different strings.

   --
   Brett Ritter / SwiftOne
   swift...@swiftone.org


[jQuery] binding events to dynamically created divs

2009-08-26 Thread batterhead

Hi All,

I have a page with a div that contains other divs. In the outer div, I
have links that add new divs inside. I also have a link outside the
outer div that adds more of those outer divs to the page (with an
inner div, and the same links to add more). This works on the div that
is hard coded on the page, but when I use the link to add additional
container divs the links inside there to add more inner divs does not
function. I believe it has to do with binding, but I'm not certain how
to fix this issue. Any assistance would be appreciated.

Here is my code:

$(document).ready(function() {

$(.AddDisc).click( function() {
discContainerDiv = div class='discContainer'div
class='trackContainer'input type='text' class='trackInput' //
divdiv class='trackControls'a href='#' class='AddTrack'(++)/a
a href='#' class='RemoveTrack'(--)/a/div/div;
var $newDiv = $('.discContainer:last').after(discContainerDiv);
alert($newDiv.html);
return false;
});

$(.RemoveDisc).click( function() {
$('.discContainer:last').remove();
return false;
});

$(.AddTrack).click( function() {
trackContainerDiv = div class='trackContainer'input 
type='text'
class='trackInput' value='dynamic div' //div;
$(this).parent().parent().end().prev().after(trackContainerDiv);
return false;
});

$(.RemoveTrack).click( function() {
$(this).parent().parents(.trackDiv).end().prev().remove();
return false;
});
});

And the HTML:

div class='discContainer'
div class='trackContainer'
input type='text' class='trackInput' /
/div

div class='trackControls'
a href='#' class='AddTrack'(++)/a
a href='#' class='RemoveTrack'(--)/a
/div
/div
hr /
a href=# class=AddDisc(++)/a
a href=# class=RemoveDisc(--)/a


[jQuery] Re: How to express the AND condition in jQuery

2009-08-26 Thread John

Variable input variables are even better than an array.

Thanks,

John

On Aug 26, 2:23 pm, John jian.fang.subscr...@gmail.com wrote:
 Cool. It works. Thanks again.

 I am a beginner of jQuery and need further help on this. Practically,
 I will have variable number of inputs to do the and operation. That is
 to say, I need to pass in an array to the myselector plugin apart from
 the object, how to achieve that?

 Thanks in advance,

 John

 On Aug 26, 1:25 pm, John jian.fang.subscr...@gmail.com wrote:

  Thanks, will try.

  Does that mean that the :has operator is not designed for the AND
  operation?

  Thanks,

  John

  On Aug 26, 12:52 pm, MorningZ morni...@gmail.com wrote:

   Not sure if this is the only or best way or how fast it may or may
   not be, but does work

  http://paste.pocoo.org/show/136392/

   On Aug 26, 12:32 pm, John jian.fang.subscr...@gmail.com wrote:

Hi,

If I like to find a div with children input, img, and span,
how to express the selector:

 the div that has children of an input tag, an img tag, and  a
span tag

in jQuery?

Seems the jQuery :has can do the job, but I am not really sure if
that is the correct way.
Any insight on this is appreciated.

Thanks in advance,

John


[jQuery] Re: jquery.corner.js plugin not working with input elements

2009-08-26 Thread Mike Alsup

 I think you can't rounded a input element with this plugin. U can put the
 input inside a div element, round the div and set border=0 to your input. So
 the user think the input is rounded, but actualy is the div outside.

Leonardo is correct, this plugin will not work on input elements.


[jQuery] Looping through all unchecked checkboxes - how to do it?

2009-08-26 Thread Brett DeWoody

I have a function which is executed whenever someone clicks a checkbox
on the page.  There are lots of checkboxes on the page.  I want the
function to be performed on only the unchecked boxes.  I've tried this
two ways, neither of which has worked.  Here are the two methods I've
tried.

Method #1
$(.item input:unchecked).each(
 function() {
  if ($(this).val()  diff) {
$(this).attr('disabled', true);
  } else {
$(this).removeAttr('disabled');
 }
 }
);

Method #2
$(.item input).each(
 function() {
  if ($(this).is(:unchecked)) {
if ($(this).val()  diff) {
$(this).attr('disabled', true);
} else {
$(this).removeAttr('disabled');
}
   }
 }
);

Where diff is an integer and the values of the checkboxes are all
integers.  The problem is the function ends up getting run on all
checkboxes, even boxes that have been checked.

Is there another way to do this?  Something I'm missing.

Thanks,

-Brett


[jQuery] Same classes div problem

2009-08-26 Thread Jose

Hey everyone,

So I have a set of divs all with the same class name, all of these
divs have a hidden div inside of them with the class name hidden

I wrote this and it seemed to work, except ALL hidden divs show
instead of the one being hovered:

$(.product-right).mouseover(function() {
$(.product-right .hidden).show();
});

I want only the div that is being hovered to show its hidden div,
unique IDs are sort of not a possibility so I was wondering if there
was anyway to do it with jquery?

Thanks

Jose


[jQuery] Re: Same classes div problem

2009-08-26 Thread James

$(.product-right).mouseover(function() {
$(.hidden, this).show();
});

On Aug 26, 9:45 am, Jose jose.bal...@gmail.com wrote:
 Hey everyone,

 So I have a set of divs all with the same class name, all of these
 divs have a hidden div inside of them with the class name hidden

 I wrote this and it seemed to work, except ALL hidden divs show
 instead of the one being hovered:

         $(.product-right).mouseover(function() {
                 $(.product-right .hidden).show();
         });

 I want only the div that is being hovered to show its hidden div,
 unique IDs are sort of not a possibility so I was wondering if there
 was anyway to do it with jquery?

 Thanks

 Jose


[jQuery] Re: Same classes div problem

2009-08-26 Thread James

Or:

$(.product-right).mouseover(function() {
$(this).find(.hidden).show();
});

On Aug 26, 11:03 am, James james.gp@gmail.com wrote:
         $(.product-right).mouseover(function() {
                 $(.hidden, this).show();
         });

 On Aug 26, 9:45 am, Jose jose.bal...@gmail.com wrote:

  Hey everyone,

  So I have a set of divs all with the same class name, all of these
  divs have a hidden div inside of them with the class name hidden

  I wrote this and it seemed to work, except ALL hidden divs show
  instead of the one being hovered:

          $(.product-right).mouseover(function() {
                  $(.product-right .hidden).show();
          });

  I want only the div that is being hovered to show its hidden div,
  unique IDs are sort of not a possibility so I was wondering if there
  was anyway to do it with jquery?

  Thanks

  Jose




[jQuery] Re: .load() doesn't work on first call in FF3 and IE (But works in FF3.5)?

2009-08-26 Thread D A

 Looks like a case of asynchronous-itis. You're reading the val() of
 the load()-ed div before the Ajax call has had a chance to respond.

 What you'll want to do is add the fancyBox stuff to the callback
 function for load() like this:

Leonard:

Thanks! You *were* on the right track with that advice. That was
definitely part of the issue.

The other issue was that we were trying to trigger two events
(FancyBox and .load()) on one DOM element.

The fix was a combination of your suggestion, and adding a second HTML
element that gets triggered from the first elements event.

HTML:

img id=loadTrigger  src=button.gif /a href=#divToDisplay
id=fancyboxTrigger/a

jQuery:

$('#fancyBoxTrigger').fancybox({
'hideOnContentClick': false,
frameWidth: 660,
frameHeight: 700,
overlayOpacity: .6,
padding: 0
});

$('#loadTrigger').click(function(){

$('#loadedContent').load('page.php',{'zip':$('#zip').val()},function(){$('#fancyBoxTrigger').click()});
});

Whew!

-DA


[jQuery] Re: jQuery selector for style attribute

2009-08-26 Thread James

As Paolo mentioned, despite how it looks in a browser's source, the
internal representation within the DOM may be different depending on
the browser.
In one browser it could be:
overflow: auto; width: 356px; height: 100px;

in another it could be:
overflow:auto; width:356px; height:100px;

in another it could be:
overflow:auto;width:356px;height:100px;

There's got to be a better way to achieve what you want to do. Since
we have no idea what you're trying to do, maybe you could explain it
as to what the rhyme or reason to the selection sets you're trying to
select is.
Looking at the code you've provided, is it possible to use the ID in
anyway? You could do selections with conditions like if ID begins
with 'ext-gen' and other conditions along with that. As long as
you're not trying to read the style string.


On Aug 26, 4:06 am, John jian.fang.subscr...@gmail.com wrote:
 Thanks.

 Here is the html source,

  div id=x-form-el-ext-comp-1043 class=x-form-element
 style=padding-left: 130px;
         div id=ext-gen438 class=x-form-field-wrap style=width:
 360px;
             input id=programId type=hidden name=programId
 value=/
             input id=ext-comp-1043 class=x-form-text x-form-field
 x-combo-noedit type=text autocomplete=off
                    size=24 readonly=true style=width: 343px;/
             img id=ext-gen439 class=x-form-trigger x-form-arrow-
 trigger style=overflow: auto; width: 356px; height: 100px;
 src=images/s.gif/
         /div
     /div

 The style in the jQuery selector should match the one defined in the
 html source. I wonder if I
 did any other thing wrong here.

 Thanks,

 John
 On Aug 26, 6:45 am, Paolo Chiodi chiod...@gmail.com wrote:

  Maybe that that the style attribute value should be exactly equal to
  the one contained in html. I think style=A:B C:D doesn't match
  style=C:D A:B.
  May also be that the browser has an internal rapresentation of the
  style attribute slightly different from the one written in the html
  (never tried to see with firebug some differen orders?).

  Otherwise if you create the style attribute by using .css('A','B'),
  you can't be sure of what the entire style attribute could be.

  Paolo

  On Tue, Aug 25, 2009 at 11:22 PM, Johnjian.fang.subscr...@gmail.com wrote:

   Thanks Maurício for your quick response.

   I have a program to automatically generate jQuery selectors based on
   some UI element attributes and seems your syntax is not always
   working. For example,

   1) working:  $('div:has(input[type=text][readonly=true], img
   [style=overflow: auto; width: 356px; height: 100px;]) img')

   2) Not working: $('div:has(input[type=text][readonly=true]
   [style=width: 343px;], img[style=overflow: auto; width: 356px;
   height: 100px;]) img')

   3) Not working:  $('div:has(input[type=text][readonly=true], img
   [style=overflow: auto; width: 356px; height: 100px;]) img
   [style=overflow: auto; width: 356px; height: 100px;]')

   4) Not working:  $('div:has(input[type=text][readonly=true]
   [style=width: 343px;], img[style=overflow: auto; width: 356px;
   height: 100px;]) img[style=overflow: auto; width: 356px; height:
   100px;]')

   Here not working means it returns empty object where it should
   return non-empty object.

   Do you know what is wrong?

   Thanks again,

   John

   On Aug 25, 2:50 pm, Mauricio \(Maujor\) Samy Silva
   css.mau...@gmail.com wrote:
   Sintax for the selector is:

   $('img[style=overflow: auto; width: 356px; height: 100px;]')

   Maurício
     -Mensagem Original-
     De: John
     Para: jQuery (English)
     Enviada em: terça-feira, 25 de agosto de 2009 14:36
     Assunto: [jQuery] jQuery selector for style attribute

     Hi,

     I want to select the following image using jQuery selector to see if I
     could use the style attribute,

     img id=ext-gen439 class=x-form-trigger x-form-arrow-trigger
     style=overflow: auto; width: 356px; height: 100px; src=images/
     s.gif/

     but seems the selector

     img[style=overflow: auto; width: 356px; height: 100px;]

     does not work at all. What would be the correct selector for the style
     attribute?

     Thanks in advance,

     John




[jQuery] Re: Same classes div problem

2009-08-26 Thread Michael Geary

Yes, $(context).find(selector) is highly recommended over
$(selector,context).

It's much more understandable and it's a tiny bit faster too.

Jose, some background: When you used $(.product-right .hidden) you were
selecting *all* .product-right elements and then finding the .hidden
elements inside them.

In your mouseover callback function, 'this' holds a reference to the
specific element that received the event. That's why $(this).find('.hidden')
does what you want.

-Mike

 From: James
 
 Or:
 
 $(.product-right).mouseover(function() {
 $(this).find(.hidden).show();
 });
 
 On Aug 26, 11:03 am, James james.gp@gmail.com wrote:
          $(.product-right).mouseover(function() {
                  $(.hidden, this).show();
          });
 
  On Aug 26, 9:45 am, Jose jose.bal...@gmail.com wrote:
 
   Hey everyone,
 
   So I have a set of divs all with the same class name, all 
 of these 
   divs have a hidden div inside of them with the class name hidden
 
   I wrote this and it seemed to work, except ALL hidden divs show 
   instead of the one being hovered:
 
           $(.product-right).mouseover(function() {
                   $(.product-right .hidden).show();
           });
 
   I want only the div that is being hovered to show its hidden div, 
   unique IDs are sort of not a possibility so I was 
 wondering if there 
   was anyway to do it with jquery?
 
   Thanks
 
   Jose
 
 
 



[jQuery] Re: Looping through all unchecked checkboxes - how to do it?

2009-08-26 Thread James

It sounds like it's your selector that's incorrect. Could you post how
your HTML looks like?


On Aug 26, 9:42 am, Brett DeWoody brettdewo...@gmail.com wrote:
 I have a function which is executed whenever someone clicks a checkbox
 on the page.  There are lots of checkboxes on the page.  I want the
 function to be performed on only the unchecked boxes.  I've tried this
 two ways, neither of which has worked.  Here are the two methods I've
 tried.

 Method #1
 $(.item input:unchecked).each(
      function() {
           if ($(this).val()  diff) {
                 $(this).attr('disabled', true);
           } else {
                 $(this).removeAttr('disabled');
          }
      }
 );

 Method #2
 $(.item input).each(
      function() {
           if ($(this).is(:unchecked)) {
                 if ($(this).val()  diff) {
                         $(this).attr('disabled', true);
                 } else {
                         $(this).removeAttr('disabled');
                 }
            }
      }
 );

 Where diff is an integer and the values of the checkboxes are all
 integers.  The problem is the function ends up getting run on all
 checkboxes, even boxes that have been checked.

 Is there another way to do this?  Something I'm missing.

 Thanks,

 -Brett


  1   2   >