two confirm functions in btnAdd.Attributes.Add("onclick","return javascriptfunctionname();");

abkinv
abkinv used Ask the Experts™
on
Hi ,
 I need to display two confirm functions one after another with ok and cancel buttons  on button update click.
 I have one confirm function:
btnUpdate.Attributes.Add("onClick", "return confirm('Are you sure do you want to proceed?');"
Can I add one more?

thank you!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
You can make a function to do it like the following:
function confirmProceed()
{
  if(confirm('Are you sure do you want to proceed?'))
  {
    if(confirm('Are you really sure'))
    {
      return true;
    }
  }
  return false;
}

Then call your function like this:
btnUpdate.Attributes.Add("onClick", "confirmProceed();"

Author

Commented:
I have a gridview  on a form with custom control.  The user select a record to update and click on update button from user custom control. If one of the fields in the record equal the needed value, then I need to display confirmation box with the warning text before update, if user click ok, then I need to display the second confirmation message box.
I put this javascript function in my custom control. How I can now the  gridvew field ID to check the value  before update?
thank you for your help!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial