Is an image button pressed in JavaScript?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • F159753
    New Member
    • Apr 2008
    • 31

    Is an image button pressed in JavaScript?

    Hi,

    I have two text box and an image submit button. how should I know if the button has been pressed in a JavaScript?
    Regards,
    FF
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    If the image your are referring to is contained in a <a href> tag for a link you would add a onclick event to that link

    Comment

    • F159753
      New Member
      • Apr 2008
      • 31

      #3
      Hi ,

      Thanks for your response.

      my image is :
      <input type="image" src="images/btn_search.gif" height=20 name="searchbut ton" id="searchbutto n" alt="submit" border="0">

      and I want to put an If clause in a Script that check if this button has been pressed or not!

      Do you have any idea how?

      Thanks

      Comment

      • jeffstl
        Recognized Expert Contributor
        • Feb 2008
        • 432

        #4
        Code:
        <input type="image" src="images/btn_search.gif" height=20 name="searchbutton" id="searchbutton" alt="submit" border="0" onclick="javascriptcall"()>

        Comment

        • F159753
          New Member
          • Apr 2008
          • 31

          #5
          And how should I check in the function(javasc riptcall) if the button have been pressed?



          Originally posted by jeffstl
          Code:
          <input type="image" src="images/btn_search.gif" height=20 name="searchbutton" id="searchbutton" alt="submit" border="0" onclick="javascriptcall"()>

          Comment

          • jeffstl
            Recognized Expert Contributor
            • Feb 2008
            • 432

            #6
            Originally posted by F159753
            And how should I check in the function(javasc riptcall) if the button have been pressed?
            DrBuch answered that in your other post. The javascript will fire when the user clicks the button. You know he clicks it if the function is called.

            Other Post showing javascript

            Comment

            Working...