G
Guest
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
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