Detecting an HTML button click event
Last Post 01-08-2010 06:21 AM by David To. 4 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
GeekGirlUser is Offline
wading in the water
wading in the water
Posts:20
Avatar

--
01-05-2010 01:56 PM

    Can anyone point me to a demonstration or discussion of client side event syntax for an HTML button question type?  Specifically, I want to code an IF statement that detects when the HTML button has been clicked?  Something like this:

    if CalcCost button was clicked
         do this
    else
         do that

    What is the syntax for detecting the click event?  The short field name for the button is CalcCost.

    Richard BaileyUser is Offline
    going with the flow
    going with the flow
    Posts:66
    Avatar

    --
    01-06-2010 08:01 AM
    x2 - or even an example of how to use the HTML Button, i can't find that anywhere.
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    01-07-2010 07:18 AM
    HI, you should be able to place your client side javascript in the "Client Side Event" under "Advance Field Options". The javascript would then trigger when you click on the HTML button. Try this and see if it works for you. -- David
    GeekGirlUser is Offline
    wading in the water
    wading in the water
    Posts:20
    Avatar

    --
    01-08-2010 02:38 AM

    Thank you, David.  Actually, what I needed was the code syntax, but your kind response confirmed that I was on the right track.  Through trial and error I worked out the syntax.  For Richard Bailey, who also expressed interest in the solution, here is what worked in this case --
    1.  Include the onclick keyword in the short name of the html button question (in this case, I changed the short name from CalcCost to CalcCostonclick).  Including the onclick keyword in the shortname enables the onclick JavaScript to execute when you click the html button (instead of defaulting to the onblur script).
    2.  Then place something like this client side scripting code in the Advance Field Options to be executed when the html button is clicked:
        if ($(CalcCostonclick))
             do this
        else
             do that

    Thanks again, David.

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    01-08-2010 06:21 AM
    HI, okay. Glad you figured it out. -- David


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi