This has to be a simple question but I can't find the answer. I am trying to call my javascript function "Update_PointTracker_Account" within a modal so it executes when the modal is opened. For some reason it won't execute. However, the Onclick button calls the function perfectly. What am I doing wrong?
<div class="modal hide fade" id="Refresh_PointTracker_Program" data-keyboard="false" data-backdrop="static" aria-hidden="true">
<div class="modal-header" align='center'>
<h3>Refreshing PointTracker Program</h3>
</div>
<div class="modal-body" style="text-align: center">
<p> The points program is being refreshed</p>
</div>
<div style="text-align: center" id='updated_program_list'></div>
<script>
Update_PointTracker_Account();
</script>
<div class="modal-footer">
<button onclick ="Update_PointTracker_Account()" class="btn" aria-hidden="true">Update</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>