run javascript function from master page button
<p>I have a javascript function on the child page that I need to run when the save button on the master page is clicked.</p>

<pre><code>ValidateCheckList = function() {
        var ErrorCodeU1001 = "U1001";
        var ErrorCodeU1002 = "U1002";
        var ErrorCodeU1003 = "U1003";

        var errors = [];
        $('&lt;%= errorsHiddenField.ClientID %&gt;').val("0");

        var fingerprintsTaken = $('&lt;%= FingerprintsTakenYesNo.PluginSelector %&gt;').YesNoPlugin(YesNoMethodsEnum.IsYes);
        if (!fingerprintsTaken) {
            errors.push(ErrorCodeU1001);
        }

        var dnaTaken = $('&lt;%= DNATakenYesNo.PluginSelector %&gt;').YesNoPlugin(YesNoMethodsEnum.IsYes);
        if (!dnaTaken) {
            errors.push(ErrorCodeU1002);
        }

        var photographTaken = $('&lt;%= PhotographTakenYesNo.PluginSelector %&gt;').YesNoPlugin(YesNoMethodsEnum.IsYes);
        if (!photographTaken) {
            errors.push(ErrorCodeU1003);
        }

        if (errors.length &gt; 0) {
            ('&lt;%= errorsHiddenField.ClientID %&gt;').val(errors.length.toString());
            $(document).PageUtilPlugin(PageUtilMethodsEnum.DisplayUserNotificationMessage, { messageType: "Warning", message: errors });
        }
    }
</code></pre>

<p>I have tried -</p>

<pre><code>$(document).ready(function() {
        document.getElementById("ctl00_ctl00_ContentPlaceHolder1_SaveButton").onclick = ValidateCheckList;
</code></pre>

<p>but this doesn't work.</p>

<p>It also needs to do a postback.</p>

<p>Can anyone help?</p>

<p>thanks</p>
