Wah. This one is a bit tricky.

I'm also having the same problems with my 10-month-old.
Anyway, do you take your JRT out for walks? If so, I may suggest you try this...
1. Leash your JRT.
2. Have your JRT "sit and stay" before the gate is open. Have your hand on the leash. If your JRT pulls or tries to escape once the gate is open, have to correct and force them to sit.
3. Only allow them to go out when you give the command "OK" or you lead your JRT out.
4. Be patient. Have to keep trying until your JRT learns it.
I'm training my JRT to do this for all doors which he wants to go out from.
Other sifus... Any other suggestions?
Mine... I hold him first. When he try to walk .... I will say with a loud voice "NO" Sit down..... (pukul ...la... the bum a bit
A couple of times.... now so easy... every time i open the gate he will sit and not run out....... even if there a cat there......