www.webdeveloper.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Location
    London
    Posts
    164

    Triggering javascript with submit button

    Hey all, Someone has helped me out with some javascript to launch an iframe popup when submit is clicked. I need to put the form in a PHP repeat region so I'll need to add a counter to the button ID so it appears as zoomProduct1, zoomProduct2 etc for each record being displayed. Problem is that this stops the following JS from working. Can anyone help me modify the code below so it will trigger from any ID begginning with zoomProduct, or is there any other workaround? Thanks guys

    $(document).ready(function() {
    $("input#zoomProduct").colorbox({href: function(){
    var url = $(this).parents('form').attr('action');
    var ser = $(this).parents('form').serialize(); //alert(url+'?'+ser);
    return url+'?'+ser;
    }, innerWidth:760, innerHeight:"554", iframe:true});
    });

  2. #2
    Join Date
    Jun 2008
    Location
    London
    Posts
    164
    It's OK I got it...

    $("input.zoomProduct").colorbox

    then add the class zoomProduct to the button.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



Recent Articles