[jQuery] Re: Update cart without page refresh

2008-08-29 Thread Jack Killpatrick


Do you want to hit the server to put the item in a cart there (for 
session/persistance) and then refresh the minicart or do you want to set 
a cookie or something in the client and update the minicart with data 
you already have in the client?


If you want to hit the server, do you have any services exposed that can 
handle an ajax call?


- Jack

netcomp wrote:

Hi there, I'm a novice with jquery and would like to create a shopping
cart where I can add a product without refreshing the page.  I've
searched extensively and can only find tutorials about drag and drop
functionality.  All I want to be able to do is hit the add button and
the minicart gets updated nothing fancy.  Right now the site is
running on a custom cart that I wrote a couple of years ago so the
database functionalty is already in place.  The site runs on asp/
vbscript with an access database behind it.

If someone has a link to a simple tutorial or can explain the logic
behind the functionality I can probably figure it out.

Thanx ahead of time.

  





[jQuery] an ajax load selector function to replace element

2008-08-29 Thread moester

I kept having to do

$('#content').load(url + " #content");

but ended up having




What i ready wanted was to completely replace the element with
selected content from an ajax load, hence,

$('#content).replace(url);


/**
 * ajax load content and replace self
 * replaced object must have 'id'
 */
jQuery.fn.replace = function( url, params, callback){

var id = this.get(0).id;
if (id) url += " #"+id;
else {alert('replace object must have id!');}

callback = callback || function(){};
var self = this;
$('').load(url, params, function(){
self.before($(this).find('#'+id)).remove();
callback.apply(this,arguments);
});
}

Hope someone experienced with jQuery can clean this up or suggest
another way.



[jQuery] Re: jquery cycle pager question

2008-08-29 Thread Mike Alsup

> i'm trying to create a "news ticker" using the cycle plugin.
> everything works really well, but i run into some trouble -
> first, i want to use the pager to show which article is on and how
> many there are, but i want it on the right side or at the bottom of
> the div containing the item. i couldn't find a simple way to go about
> it yet, other then styling it in a fashion i'm trying to avoid. would
> be much easier if there was a way to render the pager code elsewhere
> on the page (other then ".before" the main div). is there?


The pager can be whereever you want it to be.  Many of my examples use
".before", but that doesn't mean you have to.Here's an example
that doesn't use before:

http://www.malsup.com/jquery/cycle/pager4.html



> second, i want the transitions to pause when the mouse is over the
> "news div". i've tried using this code, to no avail (it pauses, but
> does not resume):
> 


You have a typo: onMousOut.  But if s4 is your slideshow you should
just use Cycle's "pause" option instead.  See item #4 on this page:

http://www.malsup.com/jquery/cycle/begin.html

Mike


[jQuery] jquery cycle pager question

2008-08-29 Thread delius

i'm trying to create a "news ticker" using the cycle plugin.
everything works really well, but i run into some trouble -
first, i want to use the pager to show which article is on and how
many there are, but i want it on the right side or at the bottom of
the div containing the item. i couldn't find a simple way to go about
it yet, other then styling it in a fashion i'm trying to avoid. would
be much easier if there was a way to render the pager code elsewhere
on the page (other then ".before" the main div). is there?

second, i want the transitions to pause when the mouse is over the
"news div". i've tried using this code, to no avail (it pauses, but
does not resume):


any help would be greatly appreciated!

cheers,

adam


[jQuery] Re: Append Node to XmlDocument

2008-08-29 Thread Patrick Burrows
Of course, this works just fine using the built-in methods of XmlDocument
(appendChild, createElement).

I am just mildly surprised this does not work with the JQuery methods.

On Fri, Aug 29, 2008 at 8:37 PM, Patrick Burrows <[EMAIL PROTECTED]> wrote:

> At this point I've tried every combination of .after I could think of. I
> think, at this point, this is simply not possible using JQuery.
>
> On Fri, Aug 29, 2008 at 7:50 PM, Patrick <[EMAIL PROTECTED]> wrote:
>
>>
>> Is anyone aware of a simple example which appends a node to an
>> existing XmlDocument?
>>
>> I am successfully able to update an XmlDocument using the attr()
>> method. So:
>>
>> $(xmlElement).attr("Name","new name");
>>
>> I am even able to create new attributes using this method.
>>
>> What I would like to be able to do now is create a new child element
>> of that same xmlElement. I have tried using the after() and
>> insertAfter() methods:
>>
>> $(xmlElement).after("");
>>
>> but this does not update the main XmlDocument. I can tell this by
>> using FireBug's dirxml() output display. So if I do:
>>
>> console.dirxml(myXmlDoc);
>> $(xmlElement).after("");
>> console.dirxml(myXmlDoc);
>>
>> the outputs are exactly the same.
>>
>> Can anyone shed some light on this issue? Thanks.
>>
>
>
>
> --
> --
> Patrick Burrows
> http://www.CleverHumans.com
>



-- 
--
Patrick Burrows
http://www.CleverHumans.com


[jQuery] Re: Append Node to XmlDocument

2008-08-29 Thread Patrick Burrows
At this point I've tried every combination of .after I could think of. I
think, at this point, this is simply not possible using JQuery.

On Fri, Aug 29, 2008 at 7:50 PM, Patrick <[EMAIL PROTECTED]> wrote:

>
> Is anyone aware of a simple example which appends a node to an
> existing XmlDocument?
>
> I am successfully able to update an XmlDocument using the attr()
> method. So:
>
> $(xmlElement).attr("Name","new name");
>
> I am even able to create new attributes using this method.
>
> What I would like to be able to do now is create a new child element
> of that same xmlElement. I have tried using the after() and
> insertAfter() methods:
>
> $(xmlElement).after("");
>
> but this does not update the main XmlDocument. I can tell this by
> using FireBug's dirxml() output display. So if I do:
>
> console.dirxml(myXmlDoc);
> $(xmlElement).after("");
> console.dirxml(myXmlDoc);
>
> the outputs are exactly the same.
>
> Can anyone shed some light on this issue? Thanks.
>



-- 
--
Patrick Burrows
http://www.CleverHumans.com


[jQuery] Re: ajax?

2008-08-29 Thread Patrick Burrows
It looks to me like you forgot to write any JavaScript to do all the actions
you described below.

On Fri, Aug 29, 2008 at 7:21 PM, fear and wonder
<[EMAIL PROTECTED]>wrote:

>
> what i'm trying to do is have a login form on my site, it looks like
> this right now...
>
> Email:
> 
> Password:
> 
> 
>
>
> then when you click submit it uses ajax to load the login page that
> checks if you entered the right email and password. if you didn't, it
> would show the login form again. but if you try to login again,
> nothing happens. why is this not working??
>



-- 
--
Patrick Burrows
http://www.CleverHumans.com


[jQuery] Re: Cycle with anchors on images not working properly

2008-08-29 Thread Mike Alsup

> Ok so I tried what you said but still no change.
>
> I am new to jQuery so please excuse my ignorance in the questions
> below.
>
> I am not sure what exactly this line does:
> onAfter.apply($('a:first')[0]);

That line isn't needed.  The anchor demo was written before I added
synthetic events for the first image in the plugin.  The point was to
invoke the callback for the first image before any transition had
occurred. But, as I said, it's no longer necessary.  I pasted your
code into the following page, (swapping out the images), and it seems
to be working fine.  If you're still having trouble can you post a
link to your test page (or send it to me directly).

http://www.malsup.com/jquery/cycle/test/egil.html

Mike


[jQuery] ajax?

2008-08-29 Thread fear and wonder

what i'm trying to do is have a login form on my site, it looks like
this right now...

Email:

Password:




then when you click submit it uses ajax to load the login page that
checks if you entered the right email and password. if you didn't, it
would show the login form again. but if you try to login again,
nothing happens. why is this not working??


[jQuery] Append Node to XmlDocument

2008-08-29 Thread Patrick

Is anyone aware of a simple example which appends a node to an
existing XmlDocument?

I am successfully able to update an XmlDocument using the attr()
method. So:

$(xmlElement).attr("Name","new name");

I am even able to create new attributes using this method.

What I would like to be able to do now is create a new child element
of that same xmlElement. I have tried using the after() and
insertAfter() methods:

$(xmlElement).after("");

but this does not update the main XmlDocument. I can tell this by
using FireBug's dirxml() output display. So if I do:

console.dirxml(myXmlDoc);
$(xmlElement).after("");
console.dirxml(myXmlDoc);

the outputs are exactly the same.

Can anyone shed some light on this issue? Thanks.


[jQuery] Update cart without page refresh

2008-08-29 Thread netcomp

Hi there, I'm a novice with jquery and would like to create a shopping
cart where I can add a product without refreshing the page.  I've
searched extensively and can only find tutorials about drag and drop
functionality.  All I want to be able to do is hit the add button and
the minicart gets updated nothing fancy.  Right now the site is
running on a custom cart that I wrote a couple of years ago so the
database functionalty is already in place.  The site runs on asp/
vbscript with an access database behind it.

If someone has a link to a simple tutorial or can explain the logic
behind the functionality I can probably figure it out.

Thanx ahead of time.


[jQuery] Re: Cycle with anchors on images not working properly

2008-08-29 Thread richardegil

Ok so I tried what you said but still no change.

I am new to jQuery so please excuse my ignorance in the questions
below.

I am not sure what exactly this line does:
onAfter.apply($('a:first')[0]);

I can see what the onAfter function does, but this line makes no sense
to me.  Am I calling the right thing?  Should I change it to,
onAfter.apply($('#slide a:first')[0]);, since it resides in the #slide
div?

Any help would be appreciated, please feel free to look at my code
below.


Here is my code:


$.fn.cycle.defaults.timeout = 6000;
$(function() {
$('#slide').cycle({
fx: 'fade',
timeout: 1,
delay:  0,
next:   '#next2',
prev:   '#prev2',
after: onAfter
});
onAfter.apply($('a:first')[0]);

});

function onAfter() {
$('#output').html('learn more');
}












prev  |  next



-Richard

On Aug 28, 4:58 pm, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > I have the Cycle plug-in working on a site I am creating, and I am
> > trying to use anchor tags on the images to navigate the user to a
> > different page.  I can get a text link to change depending on what
> > href is wrapped around the image, but the images will not change what
> > they are linking to.  Whenever I hover over an image and click on it,
> > it will only use the href of the first image no matter what image I am
> > on.  I am using this example as a guide.
>
> >http://malsup.com/jquery/cycle/anchor.html
>
> > Anybody else have this problem
>
> If your markup looks like that in the demo then make sure you give
> youranchorsa display:block style.
>
> Mike


[jQuery] Re: Repeating a function call on hover/mouseover/etc

2008-08-29 Thread micah

one way to approach what you're trying to do is with a simple
setInterval (http://developer.mozilla.org/index.php?title=En/DOM/
Window.setInterval), so that the parser has a bit of breathing room
between calls to someFunc.

if you just loop through, you're essentially saying "call someFunc as
many times as you can, as fast as you can possibly call it", which
isn't really cpu-friendly ;)

try this instead:

var int = null;
$('#element').hover(function() {
  int = setInterval(someFunc, 100);
}, function() {
  clearInterval(int);
});

-micah

On Aug 29, 2:00 pm, Leanan <[EMAIL PROTECTED]> wrote:
> Hey guys.
>
> I've poured over the docs, and mouseover/hover/etc only trigger once.
> I want it to continue to trigger a function while the element is
> hovered.
>
> I've tried:
>
> $('#element').hover(function() {
>   while(true) {
>     someFunc;
>   }
>
> }, function() {});
>
> Unfortunately, this screws things up.  The while loop hangs the
> browser for a while before it finally throws the "this script has been
> running too long" message.
>
> I've tried looking at some of the scrolling plugins to see how they do
> it but the only one I can find that seems to have this functionality
> (do something while hovering over an element, in this case, continue
> scrolling) has no documentation, and the examples do not explain how
> to use the plugin, they merely show it working.  What little bit of
> text is on the page is non-english and from the looks of it is little
> more than headers anyway, so useless even if I translated it.
>
> So, how should I go about continuing to trigger someFunc while I'm
> hovered over a particular item on the page?


[jQuery] Re: Multiple AJAX calls problem

2008-08-29 Thread micah

a common trick i use to get around situations where an event may be
bound twice is to add an unbind into the chain. like so:

var kd = function(event) {
alert(event.keyCode);
}

$().unbind('keydown', kd).keydown(kd);

it's a bit quick and dirty, but it works.

-micah


On Aug 29, 9:12 am, me-and-jQuery <[EMAIL PROTECTED]> wrote:
> Hello. So I have a problem that when I get jQuery code in ajax
> response and you click few times to activate ajax call, there are
> multiple instances of same code. Lets see the example with keydown.
>
> FILE 1:
> 
> $(document).ready(
>         function() {
>                         $("#my_div").click(function() {
>                                         $.ajax({
>                                                         type: "GET",
>                                                         url: "test.php",
>                                                         success: 
> function(data) {
>                                                                         
> $("#div_ajax").html(data);
>                                                         }
>                                         })
>                         })
>         }
> )
> 
> Click here
> 
>
> FILE 2 - AJAX RESPONSE:
> 
> $().keydown(function(event) {
>                 alert(event.keyCode);});
>
> 
> Ajax content loaded...
>
> So, if I click on my_div twice, there will be two listeners for keys
> and for same keydown two alerts.
>
> I can solve this issue with ifs, but what is the best way to prevent
> this behaviour? Maybe in the way of singletons or something?
>
> Thanks for any advice, I am sure there must be simple and effective
> solution. Have a nice day.


[jQuery] Re: Newbie: JQuery to determine browser and apply CSS

2008-08-29 Thread GiJeet

>On Aug 29, 4:42 pm, Matt <[EMAIL PROTECTED]> wrote:
> Check the docs:http://docs.jquery.com/Utilities
>
> example:
>
> if( jQuery.browser.mozilla ) {
>     //do css stuff...
>
> }

Thanks!


[jQuery] Possible animate (negative) bug w/ Firefox 2

2008-08-29 Thread skube

I am experiencing a problem with Firefox 2 and jQuery 1.2.6. I am
doing a basic slide using the $.animate into negative territory. The
animation jumps to the positive value quickly before resting at the
correct negative value. The larger the negative value, the larger the
positive swing.

This is only an issue of FF2 PC. It seems to work fine in all other
browsers FF3 Mac/PC, IE6, IE7, Safari 2, Safari 3

This is how I'm calling it:
$("#myTab").animate({
  botttom:"-100px"
}, 300)

Any suggestions appreciated.


[jQuery] Repeating a function call on hover/mouseover/etc

2008-08-29 Thread Leanan

Hey guys.

I've poured over the docs, and mouseover/hover/etc only trigger once.
I want it to continue to trigger a function while the element is
hovered.

I've tried:

$('#element').hover(function() {
  while(true) {
someFunc;
  }
}, function() {});

Unfortunately, this screws things up.  The while loop hangs the
browser for a while before it finally throws the "this script has been
running too long" message.

I've tried looking at some of the scrolling plugins to see how they do
it but the only one I can find that seems to have this functionality
(do something while hovering over an element, in this case, continue
scrolling) has no documentation, and the examples do not explain how
to use the plugin, they merely show it working.  What little bit of
text is on the page is non-english and from the looks of it is little
more than headers anyway, so useless even if I translated it.

So, how should I go about continuing to trigger someFunc while I'm
hovered over a particular item on the page?


[jQuery] Applying jqDnR to images.

2008-08-29 Thread Ronn Ross
Hello all,

I'm using jqDnR (http://dev.iceburg.net/jquery/jqDnR/) to allow things to be
draggable on the my page. Applying it to div tags is super easy and works
great. Unfortunately when I try to apply it to an image I can't get it to
work. This is what I use for a div:
$('#container').jqDrag('.Drag').jqResize('.Resize');

I just want to make the image draggable without resizing options.

Thanks


[jQuery] Re: Basic Help please - Only returning 1 value

2008-08-29 Thread Mattl

Hi,
Finally got the drop-down to appear and list everything correctly, I'd
put '\n' in the php rather than "\n" - Oooops!!

Thanks for your suggestions though.

Matt

On Aug 29, 4:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I don't think it's the formatting. In your original query, you were
> only collecting saleno. In your second, you're specifically matching a
> certain saleno but applying the wildcard on lotno. Also, you might try
> ordering your comparisons. Something like:
>
> "SELECT `LotNo`, `A`, `Description` FROM batemans WHERE
> (`SaleNo` LIKE $SaleNo) AND (`LotNo` LIKE '%$q%') ORDER BY LotNo ASC";
>
> Here's the docs on mysql string 
> comparison:http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html
>
> Do you use phpMyAdmin? It's a good tool for figuring our mysql
> queries.
>
> On Aug 28, 11:15 pm, Mattl <[EMAIL PROTECTED]> wrote:
>
> > Thanks - I've changed the Query to:
>
> > $query = "SELECT `LotNo`, `A`, `Description` FROM batemans WHERE
> > `SaleNo` LIKE $SaleNo AND `LotNo` LIKE '%$q%' ORDER BY LotNo ASC";
>
> > but it still only shows one value in the drop-down.
>
> > The output of the query can be seen at (this shows multiple values, ie
> > the query is working):
>
> >http://www.batemans-auctions.co.uk/js/autocomplete.php?SaleNo=102&q=2
>
> > Is it the formatting of the output?
>
> > Thanks
> > Matt
>
> > On Aug 28, 10:44 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Try using a mysql wildcard (%) in your query. Something about like
> > > this:
>
> > > $query = "SELECT `LotNo`, `A`, `Description` FROM batemans WHERE
> > >  `SaleNo` LIKE $SaleNo% ORDER BY LotNo ASC";
>
> > > That should return 200, 21, or 2  for an entry or "2" for SaleNo.
>
> > > On Aug 28, 1:18 pm, Mattl <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
> > > > Clearly I'm doing something basic wrong here, please can someone point
> > > > it out?
>
> > > > I'm only getting the value that's entered into the autcomplete box
> > > > returned in the drop-down list (ie If I enter '2' only get '2' back
> > > > not '2', '20', '21' etc)
>
> > > > Here's my code:
>
> > > > $("#lotno1").autocomplete("../js/autocomplete.php?SaleNo=102", {
> > > >                                 matchContains: true,
> > > >                                 mustMatch: true,
> > > >                         });
>
> > > > });
>
> > > > Here's the content of 'autocomplete.php':
>
> > > > 
> > > >  > > > $SaleNo = ($_GET["SaleNo"]);
> > > > $q = strtolower($_GET["q"]);
>
> > > > mysql_select_db($database_Oundle_DB, $Oundle_DB);
> > > > $query = "SELECT `LotNo`, `A`, `Description` FROM batemans WHERE
> > > > `SaleNo` LIKE $SaleNo ORDER BY LotNo ASC";
> > > > $result = mysql_query($query, $Oundle_DB) or die(mysql_error());
> > > > while($row=mysql_fetch_assoc($result))
> > > > if (strpos(strtolower($row['LotNo']), $q) !== false) {
> > > >         echo $row['LotNo'].$row['A'].'|'.$row['Description'].',';}
>
> > > > ?>
>
> > > > Any help greatly appreciated.
>
> > > > Thanks
> > > > Matt


[jQuery] Re: jQuery selector works with FF and not on IE

2008-08-29 Thread micah

you can do $(':input:visible') instead.

i've found that :not can be picky at times. could be totally imagined
on my part, but i usually use $.not() instead, despite the extra
traversal of the nodeset involved.

-micah

On Aug 29, 10:19 am, anuradha k <[EMAIL PROTECTED]>
wrote:
> Hi All
>
> I am trying to do a simple jQuery, where in the selector fetches me
> all the empty fields in the form page.
>
> var inputFieldsArray = $(":input:not(:hidden)"); // to get the fields
> that arent hidden
>
>   for(var i=0; i          var trClass = $
> (inputFieldsArray[i]).parents("tr:first").attr("class");
>
>          if (trClass == "wcgRequired wcgErrorRow") { // if this value then
> set wcgFieldtype as required
>
>          if ($(inputFieldsArray[i]).attr("class") != 'wcgFieldNotRequired') {
>
>                 $(inputFieldsArray[i]).attr("wcgFieldType", "required");
>                 if (($(inputFieldsArray[i]).attr("value") == undefined)||($
> (inputFieldsArray[i]).attr("value") == null)||($
> (inputFieldsArray[i]).attr("value").trim().length == 0) )   // if this
> is true then set wcgFieldState = empty
>                 {
>
>                 $(inputFieldsArray[i]).attr("wcgFieldState", "empty");
>                  var requiredButEmpty = $(":input[wcgFieldState='empty']");
>                  alert("requiredButEmpty" 
> +requiredButEmpty.length.toString()); //
> this value is always 0 in case of IE but FF fetches me the right value
>
>                 }
>
> I have included the inline comments for better understanding.  I have
> been struggling with this for almost a week and I am unable to find
> the root cause
>
> Any help in this regard is greatly appreciated
>
> thank you
> Anuradha K


[jQuery] Re: Newbie: JQuery to determine browser and apply CSS

2008-08-29 Thread Matt

Check the docs: http://docs.jquery.com/Utilities

example:

if( jQuery.browser.mozilla ) {
//do css stuff...
}

On Aug 29, 10:44 am, GiJeet <[EMAIL PROTECTED]> wrote:
> Hello, is it possible to use JQuery to determine the browser type/
> version at runtime and apply a custom .css specific to that browser
> type?  If so, would appreciate some sample code so I can see how it's
> done.  TIA
>
> G


[jQuery] Re: jqModal and IE problems

2008-08-29 Thread Alexandre Plennevaux
did you try changing the doctype ?


Alexandre Plennevaux

http://www.lab-au.com


On Fri, Aug 29, 2008 at 9:44 PM, MorningZ <[EMAIL PROTECTED]> wrote:

>
> So i have some usage of jqModal in my project
>
> and this is what's going on:
>
> (screenshot: http://i38.tinypic.com/2edavs2.jpg)
>
> you can see that "jqmOverlay" has a z-index of 2999
>
> and
>
> jqmWindow has a z-index of 3000
>
> So, in a correct and working world, jqmWindow should be *on top* of
> jqmOverlay  (which Firefox respects and works)
>
>
>
> i found this looking for "IE a-index problems"
>
> http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html
>
> but that doesn't explain how to fix the issue.
>
> and even stranger is that the jqModal sites works just fine in IE, but
> i see no difference in the HTML or positioning
>
> anyone run across this and/or have a work areound?
>


[jQuery] Re: Autocomplete not firing in IE

2008-08-29 Thread gemeaux

Sorry, my mistake. There was extraParams line after that comma. So,
jQuery code should be like this:

$(document).ready(function(){

$("#txtSearchBox").autocomplete("Autocomplete.aspx",
{
maxItemsToShow: 10,
minChars: 3,
delay: 40,
width: 270,
extraParams: {dID: 3}
});

});


[jQuery] Re: [autocomplete] Auto populate form input field based on another

2008-08-29 Thread Mattl

Hi,
Finally got the first drop-down to appear, I'd put '\n' in the php
rather than "\n" - Oooops!!

Still not sure how to get the second field on my form to update based
on the input to the first autocomplete, any suggestions?

This is what I've tried:

$(document).ready(function(){

$("#lotno1").autocomplete("../js/autocomplete.php?SaleNo=103", {
matchContains: true,
mustMatch: true,
});
$("#descno1").autocomplete("../js/autocomplete.php?SaleNo=103", {
extraParams: {
first: function() {
return $("#lotno1").val();
}
}
});

});

The two columns from the db are 'LotNo' and 'Description' returned
from the php as:

echo ($row['LotNo'].$row['A'].'|'. $row['Description']."\n");

I need $row['LotNo'].$row['A'] => to #lotno1 (this works) and
$row['Description'] => #descno1

Thanks
Matt



On Aug 27, 10:13 pm, Mattl <[EMAIL PROTECTED]> wrote:
> Hi Jorn,
>
> I now have the following based on your suggestion to populate the
> second input field:
>
> $(document).ready(function(){
>
> $("#lotno1").autocomplete("../js/autocomplete.php?SaleNo=102", {
>                                matchContains: true,
>                                mustMatch: true,
>                        });
>
> $("#descno1").autocomplete("../js/autocomplete.php?SaleNo=102", {
>        extraParams: {
>                first: function() {
>                        return $("#lotno1").val();
>                }
>        }
>        });
>
> });
>
> where 'autocomplete.php' looks like:
>
> 
>  $SaleNo = ($_GET["SaleNo"]);
> $q = strtolower($_GET["q"]);
>
> mysql_select_db($database_Oundle_DB, $Oundle_DB);
> $query = "SELECT `LotNo`, `A`, `Description` FROM batemans WHERE
> `SaleNo`
> LIKE $SaleNo ORDER BY LotNo ASC";
> $result = mysql_query($query, $Oundle_DB) or die(mysql_error());
> while($row=mysql_fetch_assoc($result))
> if (strpos(strtolower($row['LotNo']), $q) !== false) {
>                echo ($row['LotNo'].$row['A'].'|'.
> $row['Description'].'\r');}
>
> ?>
>
> You can view the page 
> at:http://www.batemans-auctions.co.uk/new_site/absentee_form.php
>
> (first input box under 'Lot No' is where to type, any number between 1
> and 500:
>
> If I enter '1' the autocomplete does not return all values in the
> mySQL field that
> contain a '1', I thought adding matchContains: true, would fix this,
> any ideas?
>
> Also when clicking the value  from the drop down, it does not populate
> the
> second field (id= descno1) with the coresponding value from the
> Description
> column, any ideas?
>
> Many thanks for your support.
>
> Regards
> Matt
>
> On Aug 27, 1:05 am, VirusMinus <[EMAIL PROTECTED]> wrote:
>
> > Hi Jorn,
>
> > Is there a way to call a function when no results are returned by the
> > input the user has typed into the autocomplete?
>
> > This would be ideal as an option or a method for the autocomplete
> > object.
>
> > I've seen a few people ask for this on your site and also here. You
> > mentioned including such functionality in a future release but I don't
> > think it was done.
>
> > Anyone mange to do this or have pointers on how I could go about
> > implementing it myself?
>
> > If I succeed maybe we can add this as a feature to the current build
> > of autocomplete?
>
> > Cheers,
> > VM
>
> > On Aug 27, 8:04 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > wrote:
>
> > > The download includes demo PHP scripts that you can look at. Or check
> > > it online 
> > > viahttp://dev.jquery.com/view/trunk/plugins/autocomplete/demo/search.phps
> > > (linked fromhttp://jquery.bassistance.de/autocomplete/demo/)
>
> > > Jörn
>
> > > On Tue, Aug 26, 2008 at 10:11 PM, Mattl <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks Jörn,
> > > > Is there a tutorial or demo that shows what the php file that queries
> > > > the db should look like, or in what format the results need to be
> > > > returned in?
>
> > > > ie what does 'my_autocomplete_backend.php' look like?
>
> > > > I've not been able to find one.
>
> > > > Thanks in advance,
> > > > Matt
>
> > > > On Aug 25, 11:32 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > > > wrote:
> > > >> The autocomplete plugin
> > > >> (http://plugins.jquery.com/project/autocompletex) can do that. Set the
> > > >> one up as usual, and configure the other one with a dynamic extra
> > > >> paramter:
>
> > > >> $("#second").autocomplete("url", {
> > > >>         extraParams: {
> > > >>                 first: function() {
> > > >>                         return $("#first").val();
> > > >>                 }
> > > >>         }
>
> > > >> });
>
> > > >> Jörn
>
> > > >> On Mon, Aug 25, 2008 at 11:22 PM, Mattl <[EMAIL PROTECTED]> wrote:
>
> > > >> > Hi,
> > > >> > Anyone know of a jQuery plugin similar to the Autocomplete that could
> > > >> > do the following?
>
> > > >> > I have a mysql db with two columns, 'Lot No' and 'Description'.
>
> > > >> > I have a form with two input fi

[jQuery] Re: Sleep or delay in JQuery

2008-08-29 Thread Michael Geary

Don't use a timer for this - it is extra complication and not very reliable.

In many cases you can simply chain the effects together, which queues them
behind the scenes:

// Slide an element open and then slide it closed
$('#test').slideDown( 'slow' ).slideUp( 'slow' );

For more complex operations, where you want to do something in addition to
the pure animation methods, you can use the completion callback that every
animation method provides:

// Slide an element open, then change
// its background color and slide it closed
$('#test').slideDown( 'slow', function() {
$(this).css( 'backgroundColor', 'green' ).slideUp( 'slow' );
});

That wouldn't work if you tried it with the chaining:

$('#test').slideDown( 'slow' ).css( 'backgroundColor', 'green'
).slideUp( 'slow' );

Because the CSS change would actually happen before *both* animations (the
animations are queued but other methods are executed directly).

Note that the callback function is called once for each matching DOM element
- so with other types of selectors it may be called more than once. With an
ID selector, or course, there should be only one.

-Mike

> From: [EMAIL PROTECTED]
> 
> Javascript offers setTimeout(code, interval_in_milliseconds). 
> If your first animation is of a precise length, you could do 
> something like
> this:
> 
> function anima1(){
> //play animation1, which is 15 seconds long }
> 
> function anima2(){
> //play animation2
> }
> 
> anima1;
> setTimeout("anima2", 15000);

> > From: Ronn
> >
> > I'm new to JQuery and I'm looking for a Sleep or Delay function. I 
> > have two animations and I want one to not start until the other has 
> > finished. Any Ideas?



[jQuery] jqModal and IE problems

2008-08-29 Thread MorningZ

So i have some usage of jqModal in my project

and this is what's going on:

(screenshot: http://i38.tinypic.com/2edavs2.jpg)

you can see that "jqmOverlay" has a z-index of 2999

and

jqmWindow has a z-index of 3000

So, in a correct and working world, jqmWindow should be *on top* of
jqmOverlay  (which Firefox respects and works)



i found this looking for "IE a-index problems"

http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html

but that doesn't explain how to fix the issue.

and even stranger is that the jqModal sites works just fine in IE, but
i see no difference in the HTML or positioning

anyone run across this and/or have a work areound?


[jQuery] Re: UI Tabs IE Style Problem

2008-08-29 Thread Brad

After a lot of trial and error I determined that the site's existing
CSS was  NOT at fault. From there I started looking at page markup.

What I eventually found was that every page is dynamically generated
and shares a common header. The first line in every page is:



Removing it fixes the problem.

-- Brad

On Aug 29, 9:13 am, Brad <[EMAIL PROTECTED]> wrote:
> I'm using the latest Tabs in a project that already has an established
> page layout. I'm using the tab styles like the ones 
> athttp://stilbuero.de/jquery/tabs_3/.
>
> On Mozilla, Opera and Safari the tabs display fine, but on IE 6 the
> space below the tab label and tab bottom is missing. As a result in IE
> 6 the tab height is less than in the other browsers, and the font
> descenders touch the tab base. BTW, Is there a way to include
> screenshots in this forum?
>
> I'm certain that something in the page's existing CSS is cascading to
> the Tab's CSS, but since it doesn't happen in the other browsers, I'm
> having a hard time figuring out what it is. I'm not a CSS expert but
> know that there are some quirks in IE.
>
> I have included the special IE CSS file, as shown below, but that
> doesn't help.
>
> 
>
> If anyone can offer any suggestions I'd greatly appreciate it.


[jQuery] Re: best techniques to optimize loading of multiple libraries?

2008-08-29 Thread Bil Corry


Alex Weber wrote on 8/29/2008 10:15 AM: 

i'd rather use packed then minified though :)


Use minified, not packed.  Although a packed file is smaller, it's overall 
performance is worse when compared to minified:

-
This means, in the end, that using a minifed version of the code is much faster 
than the packed one - even though its file size is quite larger.


-


- Bil



[jQuery] Newbie: JQuery to determine browser and apply CSS

2008-08-29 Thread GiJeet

Hello, is it possible to use JQuery to determine the browser type/
version at runtime and apply a custom .css specific to that browser
type?  If so, would appreciate some sample code so I can see how it's
done.  TIA

G


[jQuery] Re: $.get ajax method callback being called before the script return...

2008-08-29 Thread Jonny

Hey thanks, didn't know that tool, awesome =)

i was just using fiddler and there's  something bizarre happening
around here...

When i change the select box , sometimes the ajax execute sucefully,
showing response 200 on fiddler.
But most times its just don't respond... i click the select box and
fiddler shows nothing.

Well, it could just be a javascript mistyping, but The weird part is
that: if i place an alert after "function(data){ " ,
the alert is shown Everytime i click the select box.


I'll try to figure out whats happening, i think its related to the
paramenter i'm passing to get...



On 29 ago, 13:03, MorningZ <[EMAIL PROTECTED]> wrote:
> If i had to take a guess, i'd say there was an error getting raised
> from the AJAX call for whatever reason
>
> i'd suggest downloading "Fiddler" (http://www.fiddlertool.com) and
> watching the network traffic to see if the call raises an error


[jQuery] Re: Superfish: onBeforeShow and onHide callback functions

2008-08-29 Thread jefe

Joel,

That fixed it. Thanks for your help.


Justin

On Aug 28, 7:43 pm, "Joel Birch" <[EMAIL PROTECTED]> wrote:
> Hi Justin,
>
> The onHide callback will fire whenever the function that hides other
> submenus runs, which it does when moving from submenu to submenu.
> Hence, it is not suitable for detecting when the menu is completely
> idle. Maybe you could add a condition to your onHide function that
> checks the length of $('ul.sf-menu li.sfHover') and only proceed if
> the result is less than it would be for an idle menu?
>
> Joel Birch.


[jQuery] Re: Internet explorer:select tag manipulation does not ever work...?

2008-08-29 Thread anuradha k

Hi

Were you able to solve this problem. I am also facing a similar
problem and posted my problem today. So wanted to know if you were
able to find out the root cause

thank you
anuradha k

On Aug 15, 10:10 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> why is it that in firefox you can enable and disable a select tag and
> also select o deselect an option but it doesnotwork withIE??
>
>    $(":text").dblclick(function() {
>     $("#myselect").attr('disabled',
> "disabled").fadeOut('slow').children().removeAttr('selected');
>    });
>
> That code only works in FirefoxnotIE...
> help please, how do I get around this?


[jQuery] Re: $.get ajax method callback being called before the script return...

2008-08-29 Thread Jonny

I didn't knew fiddler, nice tool =)

im testing the script with fiddler now, and something very strange is
happening...

When i change the select box designated with the function, the first
times it's ok, and a 200 OK line pops on fiddler.
But after de 3th or 4th change it stop showing messages on Fiddler.

But the weird part is that I've put a alert after "function(data){" ,
and everytime i call it the message appears...



On 29 ago, 13:03, MorningZ <[EMAIL PROTECTED]> wrote:
> If i had to take a guess, i'd say there was an error getting raised
> from the AJAX call for whatever reason
>
> i'd suggest downloading "Fiddler" (http://www.fiddlertool.com) and
> watching the network traffic to see if the call raises an error


[jQuery] jQuery selector works with FF and not on IE

2008-08-29 Thread anuradha k

Hi All

I am trying to do a simple jQuery, where in the selector fetches me
all the empty fields in the form page.



var inputFieldsArray = $(":input:not(:hidden)"); // to get the fields
that arent hidden

  for(var i=0; i

[jQuery] Multiple AJAX calls problem

2008-08-29 Thread me-and-jQuery

Hello. So I have a problem that when I get jQuery code in ajax
response and you click few times to activate ajax call, there are
multiple instances of same code. Lets see the example with keydown.

FILE 1:

$(document).ready(
function() {
$("#my_div").click(function() {
$.ajax({
type: "GET",
url: "test.php",
success: function(data) 
{

$("#div_ajax").html(data);
}
})
})
}
)

Click here


FILE 2 - AJAX RESPONSE:

$().keydown(function(event) {
alert(event.keyCode);
});

Ajax content loaded...

So, if I click on my_div twice, there will be two listeners for keys
and for same keydown two alerts.

I can solve this issue with ifs, but what is the best way to prevent
this behaviour? Maybe in the way of singletons or something?

Thanks for any advice, I am sure there must be simple and effective
solution. Have a nice day.


[jQuery] Re: Sleep or delay in JQuery

2008-08-29 Thread [EMAIL PROTECTED]

Javascript offers setTimeout(code, interval_in_milliseconds). If your
first animation is of a precise length, you could do something like
this:

function anima1(){
//play animation1, which is 15 seconds long
}

function anima2(){
//play animation2
}

anima1;
setTimeout("anima2", 15000);



On Aug 28, 5:55 am, Ronn <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I'm new to JQuery and I'm looking for a Sleep or Delay function. I
> have two animations and I want one to not start until the other has
> finished. Any Ideas?
>
> Thanks in advance


[jQuery] Page reloads functions: Firefox issues.

2008-08-29 Thread Ben C

I am having a little problem and am new to jquery.  Is there something
of a page load function that is only called on an actual reload of the
page?  I am using hidden divs on my page that are shown with the click
of a button.  Shown below:


$(document).ready(function(){
   $("#edtDiv").hide();
   $("#divSecondary").hide();
   $("#testDiv").hide();
$.ajax({
url: "image_browser.aspx",
cache: false,
 success: function(html){
$("#testDiv").append(html);
 }
  });
$("#btnCancel").click(function() {
$("#edtDiv").hide("slow");
$("#divSecondary").hide("slow");
$("#btnEdit").show("slow");
divEditDiv.contentEditable = false;
})
$("#btnEdit").click(function() {
$("#edtDiv").show("slow");
$("#divSecondary").show("slow");
$("#btnEdit").hide("slow");
divEditDiv.contentEditable = true;
})
});


The problem I am having is that in firefox, acfter the .click function
is called, it will automatically go through the .hide at the top as
well, therefore rendewring the function pointless.  I can't figure out
how to make the :


$("#edtDiv").hide();
   $("#divSecondary").hide();
   $("#testDiv").hide();


not load everytime I click the edit button.  Any ideas?  This code
works perfectly in ie (that's a first for me, usually its the other
way around).

Any nudge in the right direction would be greatly appreciated.  Thanks!


[jQuery] Re: Execute script loaded into div from ajax

2008-08-29 Thread Milan Adamovsky


Hi Michael,

The solution is simpler than you think.

All you have to do when you load an HTML document that contains a
script, is to think of it as being automatically injected into your
jQuery namespace ($). This means that you no longer have to do
another .ready() or jQuery(callback) inside your AJAX'd HTML, but
simply write your script as though it were inside .ready() or
jQuery(callback).

In other words, let's assume you want to get file.html that has a
script tag such as:


 $(document).ready(function() {
 alert('Dynamically injected code executed and I want to display '
+ showHTML());

 function showHTML() {
$("b").html()
 }
  });


  My HTML


Normally, this would work if it was file.html was called directly.
What happens when you want to call file.html via jQuery's AJAX
function? Nothing. It just ignores it silently.

So basically all you have to do is remove the ready(function) since
you no longer need to worry about namespacing. As I said earlier, just
think of it as your dynamically injected  as already being
part of jQuery's namespace by the time the AJAX is finished.

The new file.html would thus simply be: