views:

565

answers:

1

How can I show a confirmation modal dialog with the information from the form so that user can confirm what they selected in the form and it submits only if the user says so?

confirm.$("#submit-button").click( function(){
     if (validator.form()==true) {
      tb_show("Countdown", "are_you_sure.html?height=100&width=200&modal=true", "");
     //some check here maybe? 
     }
     return false;


    });
A: 

tb_show can display a hidden DIV, so perhaps the best way is to fill that div with the stuff you want the user to confirm and then simply show that. The DIV could hold a YES button that when clicked performs the actual submit

<script>
$('#confirmDiv').html("Are you sure you want to...");
tb_show("Countdown", "#TB_inline?height=100&width=200&inlineId=confirmDiv");
...

<body>
...
<div id='confirmDiv' style='display:none'></div>
Scott Evernden