update prescription data in javascript