Confirmation box javascript
<p>Problem:</p>

<p>I have a confirmation box which pops up whenever I click on the save button. It saves the data fine when I click on OK. But when I click on cancel it does not cancel changes. It saves them instead. Could you please help me solve this issue:</p>

<p>Here is the JavaScript for it:</p>

<pre><code>/
&lt;asp:Button ID="view_btn_save" Text="Save" ValidationGroup="view" OnClick="view_btn_save_click"
                        OnClientClick="Validate_view()" runat="server"
                        /&gt;                        
                &lt;/td&gt;
                &lt;script type="text/javascript"&gt;
                    function Validate_view() {
                        var value = document.getElementById('&lt;%=view_txt_name.ClientID%&gt;').value;
                        var value2 = document.getElementById('&lt;%=view_txt_title.ClientID%&gt;').value;
                        var value3 = document.getElementById('&lt;%=view_txt_description.ClientID%&gt;').value;
                        var value4 = document.getElementById('&lt;%=view_txt_pixelwidth.ClientID%&gt;').value;
                        var value5 = document.getElementById('&lt;%=view_txt_pixelheight.ClientID%&gt;').value;

                        if (value == '' || value2 == '' || value3 == '' || value4 == '' || value5 == '') {
                            return alert('Please enter the missing fields');
                        }                        
                        else {
                            return confirm('Confirm changes?');
                        }
                    }
</code></pre>
