Topic: Alert message with 3 button

When you click [x] the close button, will show the alert with 3 button like below picture:

Show dialog message
=================================================
Do you want to save changes?
All details will be lost if you don't save them.
                 Dont' save | cancel | save
=================================================

I am using jquery colorbox, the code as below:

<a class='inline' href="#inline_content">[X]</a>
  <div style='display:none'>
    <div id='inline_content' style='padding:10px; background:#fff;'>

      <b>Do you want to save changes?</b>
      All details will be lost if you don't save them.
      <br/><br/>
      <%= link_to "Don't Save", main_screen_main_path %> |
      <a href="javascript:parent.$.colorbox.close()">cancel</a> |
      <%= submit_tag "save" %>

    </div>
  </div>

<script>
  $(document).ready(function(){
    $(".inline").colorbox({inline:true, width:"500"});
  });
</script>

Problem:
When I click "Save" button, it does't works...
What code should I write like :onsubmit => ?? ?
(I am weak for javascript)..

Thanks.

Last edited by jclin7 (2012-01-12 05:09:36)

Re: Alert message with 3 button

What should the "Save" button do? It won't do anything unless it's in a form or you tie javascript to it.

Last edited by wesf90 (2012-03-01 19:19:10)

Remember to edit your topic title and add "[SOLVED]" if your question has been answered!

Follow me!