Link to home
Start Free TrialLog in
Avatar of JRockFL
JRockFLFlag for United States of America

asked on

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;
                    }
                });
Avatar of BurnieP
BurnieP
Flag of Canada image

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;
      }
});
Avatar of JRockFL

ASKER

This is the first time I'm using the button control and I dont have the option of changing to input.
ASKER CERTIFIED SOLUTION
Avatar of BurnieP
BurnieP
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JRockFL

ASKER

Cool, that did it!