Refreshing an image after running JS function

Refreshing an image after running JS function

Hello,

I have a small app with one form.  It has three pages/tabs.  Page 1 and 2 have input fields.  Tab 3 has an image control.  I call a JS function to manually change the src attribute of the image to be displayed.  The following is the code in the function:

            $("#obvImage").attr("src", "/uploads/"+$("#CC__Coin_Image_Name_Obv").val());

On page 2 is a field where I enter the file name of an image I want to display.  When I Insert a new record, and go to page three, the image does display.  Attached to the field on page 2, I call my JS function and the image displays correctly when I go to page 3.  However, if I edit an existing record, and go directly to page 3, the image does not display.  I'm looking for a way to automatically refresh the image when I go to page 3.  Note, I am able to attach my JS function to the click event on the image so the image does display if I click on it.  However, I don't want to have to always click the image.  Perhaps one way is to automatically click the image when the form is opened in edit mode.  Again, I don't know how to do this.  Can anyone suggest a solution?

Thank you,

Jeff King