Thanks Eric.
I've managed to sort it. It required rethinking the whole logic and I've now mad the add-to-cart code sit in a separate file which the product form has it's action set to and I can select whatever elements to post to it that I choose. The add-to-cart then takes all the $_POST variables, puts what's received into the cart and then redirects to the showcart page. And it works a treat.
Thanks for your help. I hope this is useful to others.
All the best
Jon