Update image field with different image

Update image field with different image

How can I update an image field through a script once the image has already been set? Example:

(This is in the On Edit On Success script. When a radio button is selected I want it to trigger the image change. "Urgent" is the radio button name, "PriorityImg" is the image field name.)

  1. //Update Urgent image per selection
  2. if (input.urgent == "Yes")
  3. {
  4. input.PriorityImg = "http://mywebsite.com/images/zoho/hi_pri.png";
  5. }
  6. if (input.urgent == "No")
  7. {
  8. input.PriorityImg = "http://mywebsite.com/images/zoho/no_pri.png";
  9. }


 Using this simply replaces the image with text. Any suggestions?