Hey Guys!!
Ok, bare with me, very new to Javascript but a quick learner.
I have a couple of server control buttons on a WebForm. One of them is a basic "Next" button, while the other searches a database for a Quote Number that they provide in a text box.
I have code in the Click Event of the Search button to find matches then display options to the user, but I want to make sure that they have filled in the textbox prior to starting the search. So, I have created a javascript function and have added an "onclick" attribute to run the function, display an alert, & place focus to the textbox (if empty). This seems to work fine, but the Click event (server side) of the button continues on. How do you cancel the click event if the onclick function returns false? Is it possible?
Any thoughts, greatly appreciated!!
Thanks a bunch!!
Stacy
Ok, bare with me, very new to Javascript but a quick learner.
I have a couple of server control buttons on a WebForm. One of them is a basic "Next" button, while the other searches a database for a Quote Number that they provide in a text box.
I have code in the Click Event of the Search button to find matches then display options to the user, but I want to make sure that they have filled in the textbox prior to starting the search. So, I have created a javascript function and have added an "onclick" attribute to run the function, display an alert, & place focus to the textbox (if empty). This seems to work fine, but the Click event (server side) of the button continues on. How do you cancel the click event if the onclick function returns false? Is it possible?
Any thoughts, greatly appreciated!!
Thanks a bunch!!
Stacy