Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 330
  • Last Modified:

button click

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
JRockFL
Asked:
JRockFL
  • 2
  • 2
1 Solution
 
BurniePCommented:
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
 
JRockFLAuthor Commented:
This is the first time I'm using the button control and I dont have the option of changing to input.
0
 
BurniePCommented:
Ok,

Then try using this :

 $("button[id*=_btnSubmitOrder]").click(function () {
     if (validateNotes) {
        return true;
     }
    else {
        return false;
    }
});
0
 
JRockFLAuthor Commented:
Cool, that did it!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now