Solved

button click

Posted on 2011-03-05
4
322 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now