Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
Return false is not working in JavaScript
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Guest, post: 1993140"] Hi, I'm having an ASP.net page with a dropdown list box named ddlStatus, a button and editable gridview. I wrote a small javascript function "OnSave()" and called it on the event 'onClientClick()' event of the button. I have a required field validator for the text boxes in the grid view also. The dropdown list box contains 2 values 'Open' Or 'Close'. If the user clicks the Button by selecting the 'Close' then i have to display a confirmation message. I wrote the following function in javascript function OnSave() { var ddlStatus=document.getElementById("ddlStatus"); if(ddlStatus.selectedIndex==1) { if(confirm('Are you sure want to close this ticket number?')==false) { return false; } } } On clicking the Button, i'm getting a confirmation message with OK and Cancel.After clicking Cancel,return false is not working and the server side code is being called. Thanks in advance Srinivas [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
Return false is not working in JavaScript
Top