as long as you keep good records
there is no reason why you shouldnt do this
ALtho you have said Joint Account on which the law is straightforward - Northall is the leading case and is discussed here
http://communities.lawsociety.org.uk/private-client/ps-magazine/january-2016/casing-the-joints/5053120.fullarticle
the upshot is that the account is partitioned according who has paid in what - hence the need for records
FOr the single account I would suggest the law is the same - good records and a memo about what you have agreed,
to my mind since it obviously sets up a trust, would be enforceable on the death of the named account holder
Altho you have labelled this joint account
you dont mean that do you ?
you want it to be partitioned and repaid in proportion to the respective contributions
and NOT the survivor gets all ( a feature of joint accounts)