Hi Carlos, thank you for your speedy reply. It is working (nothing like asking a question for something to start working!).
I think it was because I was testing in preview instead of placing it on an actual page. Thank you and sorry for taking up your time.