Welcome Guest, Not a member yet? Register   Sign In
using jquery on checking duplicate data
#2

[eluser]Jay Turley[/eluser]
If I am not mistaken, you have run into the dreaded binding problem. ;-)

Because you bind your jquery event handlers to the static textboxes when the document is ready, you do not experience a problem. But the binding is only done once - at page load / DOM ready.

You need to do one of two things: read up on jQuery event handling (it looks something like this):

Code:
var that = this;
$('.auction_item_list').click(function(event) {
    var $target = $(event.target);
    if ($target.is('a')) {
        var picture_url = $target.attr('id');
        if (picture_url != '') {
            event.preventDefault();
            $('#large_item_picture').attr('src',picture_url);
        }
    } else if($target.is('img')) {
        event.preventDefault();
        var picture_url = $target.attr('id');
        $('#large_item_picture').attr('src',picture_url);
    }
});

or you need to rerun your document ready function each time you add a new dynamic input to the DOM.

HTH


Messages In This Thread
using jquery on checking duplicate data - by El Forum - 09-16-2008, 09:31 PM
using jquery on checking duplicate data - by El Forum - 09-16-2008, 09:39 PM
using jquery on checking duplicate data - by El Forum - 09-16-2008, 09:56 PM
using jquery on checking duplicate data - by El Forum - 09-16-2008, 10:11 PM
using jquery on checking duplicate data - by El Forum - 09-17-2008, 04:03 AM
using jquery on checking duplicate data - by El Forum - 09-23-2008, 04:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB