Results 1 to 3 of 3

Thread: button with mutiple onclicks

  1. #1
    Join Date
    Dec 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question button with mutiple onclicks

    I have a button on 1 of my site pages that I wish to have multiple onclick actions. It is a bid button for an auction type page. I want to be able to click it and not only have it place the bid, but play a sound. the sound plays fine on a seperate standalone button, but I need to have both functions work on the same button. This is what the code for the button looks like with just the bid function.

    Code:
    <input type="button" name="bid" id="bid" value="Bid Now" onclick="javascript:return start_bid();" />
    and this is the sound button by itself

    Code:
    <input type="button" name="sound" id="sound" value="play sound" onclick="playSound(0);" />
    I have tried

    Code:
    <input type="button" name="bid" id="bid" value="Bid Now" onclick="javascript:return start_bid();playSound(0);" />
    but it didnt produce the sound when I clicked the button. thanks for your help

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <input type="button" name="bid" id="bid" value="Bid Now" onclick="start_bid();playSound(0);" />
    should work. I do not know what the return is for in your statement.

    if it is necessary

    Code:
    <input type="button" name="bid" id="bid" value="Bid Now" onclick="playSound(0);return start_bid();" />

  3. #3
    Join Date
    Dec 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    actually, while I was going over it a few times, what I actually need is not for the button to make the sound, but the updating of the current bid.

    so if several users are on the auction, since the bid updates in realtime while they all watch, every time the current bid is updated they all hear the sound. otherwise, attached to the button, only thr user clicking the button would even hear it.

    is there such a thing as an onupdate function?? thanks again

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
  •