Hello all, im looking to set a javascipt variable on the click event of a textbox.

Asp.net code in page_load event:
Code:
Surname.Attributes.Add("onkeypress", "<script>var saved = false;</script>");
Using the javascipt console within firefox, I receive a 'syntax error'.

Any ideas where im going wrong?