here is my problem. i have a js function called changemsg that takes a label in an aspx page and sets its text to blank.
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript" >
- function changemsg(lbl){
- document.getElementById(lbl).innerHTML=" ";
- }
- </script>
Expand|Select|Wrap|Line Numbers
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- manuTextBox.Attributes.Add("onFocus", "changemsg('ctl00_ContentPlaceHolder1_manuLabel');");
- wcTextBox.Attributes.Add("onFocus", "changemsg('ctl00_ContentPlaceHolder1_wcLabel');");
- vmTextBox.Attributes.Add("onFocus", "changemsg('ctl00_ContentPlaceHolder1_descLabel');");
- }
- }
Also, it is worth noting that i am calling the same function with different labels.
my problem is that if i Enable script Debugging in internet explorer, when the page loads, the message is
"document.getElementById(...)' is null or not an object"
even if i disable script Debugging in internet explorer, the status bar would say "done but with errors" and that is the error behind it
how can i fix the problem
is my code correct?