problem to clear label value from javascript

Posted by Abhi_patil under JavaScript on 8/12/2009 | Views : 10250 | Status : [Member] | Replies : 9
i want to clear label value from javascript.

so i have written this stmt to clear value..

document.getElementById('ctl00_ContentPlaceHolder1_lblGrpSum').value="";
document.getElementById('ctl00_ContentPlaceHolder1_lblGrpSum').innerHTML="";

the value is being "".

but in searver side code after clear value i am still getting it's content.

lblGrpSum.Text //not being clear.




Responses

Posted by: Shraddhapatel on: 5/5/2019 [Member] Starter | Points: 25

Up
0
Down
you can try this code...


<script type="text/javascript">
function clearLabelValue(){
var labelObj = document.getElementById("<%= myLabel.ClientID %>");
labelObj.value = "";
}
</script>

<asp:Label id="myLabel" runat="server" Text="Some text"/>
<asp:Button id="myButton" runat="server" Text="Submit" OnClientClick="clearLabelValue();return false;"/>

ASP.NET Software companies
www.ifourtechnolab.com

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Umairaslam on: 5/7/2019 [Member] Starter | Points: 25

Up
0
Down
Thanks for appreciating. Really means and inspires a lot to hear from you guys.I have bookmarked it and I am looking forward to reading new articles. Keep up the good work..Believe me, This is very helpful for me.
By:-
rentalcarsuae.com/



Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: David230 on: 5/13/2019 [Member] Starter | Points: 25

Up
0
Down
[b]Top Quality Online Assignment Help Services[/b]
Need Assignment Help?

GotoAssignmentHelp Services is one such Australian [url=https://www.gotoassignmenthelp.com/]assignment help[/url] provider which provides a helping hand to all your academic related queries. Like [url=https://www.gotoassignmenthelp.com/]online assignment help australia[/url] and matlab assignment help They have a lot of professional experts who are skillful in giving you guidance and providing you with cheap [url=https://www.gotoassignmenthelp.com/assignment-help/cheap-assignment-writing-service/]cheep assignment help[/url] services. You are free to contact their experts by visiting their website and get your pending presentations completed on the time. Given below are some of the steps that they follow while drafting your assignments. Many students see that experts are proficient in writing your assignments but no one wonders the reason behind it. However, students pursuing IT need to understand the concepts of Java because it holds down the concept of object oriented programming.
[img]https://media.licdn.com/media-proxy/ext?w=800&h=800&hash=JhyEIwdlS71k7YD%2B%2BOEklh8CTL0%3D&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta5g-0R6nlh8Tw1It6a2FowGz60oIQY_PTWn8CnL_5aaFZnbrCKanJefQ4VgXK0h753UtLq3sGWO9R47vdMy6P7Mo1saycY2nbhUPZxcJ0jsf04BpYUlr5cujWLmhNXcegLgMPX_7JeTrYkY-TDFqqLWlBIaIe24ai2CnRuKzHOoXSrtPyIZL1QoHlYDDBJ8Zxr1e8V1cm3qozQ[/img]


Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: David230 on: 5/13/2019 [Member] Starter | Points: 25

Up
0
Down
Top Quality Online Assignment Help Services | Hire for A + Grades



Need Assignment Help?


I am David Tylor. I am an academic content writer and editor, associated with GotoAssignmentHelp for a decade. GotoAssignmentHelp is the leading plagiarism free assignment writing company. We provide customized https://gotoassignmenthelp.com/ service. We are leading the market for more than a decade now and have acquired the name of being the best academic help service for our comprehensive services at pocket-friendly rates.

We are proud of our best assignment help Australia experts because of their dedication providing continuous support to students by helping them meet deadlines and scoring better grades. We understand how important academic assessments are in developing a student's career and future opportunities, this is why we take extreme measures to ensure that all our solutions are best-in-class. All students looking for assignment help Australia can reach us and avail. We are also providing online assignment to help Malaysia and Singapore assignment help from our academic experts.


Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Majith on: 8/12/2009 [Member] Starter

Up
0
Down
Greetings Abhi,

Check whether you have cleared the corresponding label or any other labels.

clear the label on server side when binding the grid or performing any operation. add watch the label and check it.


Thanks

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goldytech on: 8/13/2009 [Member] Bronze

Up
0
Down
Try to use innerText property of javascript
Hope this helps

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 8/14/2009 [Member] Starter

Up
0
Down
You will get the contents in server side as the State of the Label controls is being stored into the ViewState of the page.

So this will not work. Instead what you can do is that you can have a hidden field and store the value of the label in the hidden variable. when you are trying to clear the label value, clear the value of hidden field as well and in the server side get the value of the hidden field using Request.Form["hiddenFieldName"].ToString();

Hope this helps.

Thanks

Regards,
Raja, USA

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakhangarg on: 8/17/2009 [Member] [Moderator] Silver

Up
0
Down
Hi -

Use like this:
document.getElementById('<%=lblGrpSum.ClientID %>').innerHTML="";

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chikul on: 12/10/2009 [Member] Bronze

Up
0
Down
Instead of using Label, Use Text Box. Make the Border Width=0.
So it'll seems like Label.
Now you can use the following to Clear it.

document.getElementById('ctl00_ContentPlaceHolder1_lblGrpSum').value='';

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response