hi guys,
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.
on the page load method of my page, i call the function as follows
i am using master pages, that is why i am saying 'ctl00_ContentP laceHolder1_des cLabel' instead of plain descLabel etc.
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.getEl ementById(...)' 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?
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.
Code:
<script type="text/javascript" > function changemsg(lbl){ document.getElementById(lbl).innerHTML=" "; } </script>
Code:
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.getEl ementById(...)' 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?
Comment