Solved

button click

Posted on 2011-03-05
4
325 Views
Last Modified: 2012-06-27
Are there any differences between "button" and "input" for the click event?
My click event is not firing.
 
                  <button id="ctl00_ContentPlaceHolder1_btnSubmitOrder" class="btn">
                        <span></span>Submit Order</button>


                $("[id$='_btnSubmitOrder']").click(function () {
                    if (validateNotes) {
                        return true;
                    }
                    else {
                        return false;
                    }
                });
0
Comment
Question by:JRockFL
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:BurnieP
ID: 35044543
Hi,

I don't think i've ever use the button control. But with input I would do it like this :

The way I would select a button like you are trying to is :

<input type="button" id="ctl00_ContentPlaceHolder1_btnSubmitOrder" class="btn" value="Submit Order"></input>

$("input[id*=_btnSubmitOrder]").click(function() {
  if (validateNotes) {
          return true;
      }
      else {
          return false;
      }
});
0
 
LVL 8

Author Comment

by:JRockFL
ID: 35044552
This is the first time I'm using the button control and I dont have the option of changing to input.
0
 
LVL 16

Accepted Solution

by:
BurnieP earned 500 total points
ID: 35044563
Ok,

Then try using this :

 $("button[id*=_btnSubmitOrder]").click(function () {
     if (validateNotes) {
        return true;
     }
    else {
        return false;
    }
});
0
 
LVL 8

Author Closing Comment

by:JRockFL
ID: 35044620
Cool, that did it!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question