I don't have a provision to not invoke the JS that tries to set a value of a field using:
getElementById(field_name).value = 'someValue'
So, as an alternative, I'm trying to see if there's a way to intercept/override the JS that sets the value of the field in the html and try to restrict it if certain conditions are met.
Please let me know if it's possible?
It may seem that this question is a duplicate of this and this but it's not. Those question's solution wants a change in the code, which is not an option for me.