Reputation: 317
in my project i am checking links whether its working or not ,when i click on create link button i want to display please wait for while but when and when if their some text in text box1if textbox1.text == null then it should not be display and when its not null then when i will click create button it should show please wait,my code is working but i want to check if their is some value in text box and user click the create button it should show please wait a while .if their no value in textbox1 then if user click on create button then please wait should not be displayed
here is my code
<script type="text/javascript">
function ShowProgressBar() {
if (Textbox1.Text == " ") {
document.getElementById('dvProgressBar').style.visibility = "hidden";
}
else {
document.getElementById('dvProgressBar').style.visibility = "visible";
}
}
</script>
<asp:Button ID="Button1" runat="server" Text="Create link" OnClick="btn_createlink_Click" OnClientClick="javascript:ShowProgressBar()" />
<br />
<div ID="dvProgressBar" style="visibility: hidden;">
<div id="content" style="text-align: left; " >
Please wait for while...
</div>
</div>
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="373px"
Width="410px" ViewStateMode="Enabled"></asp:TextBox>
Upvotes: 0
Views: 1285
Reputation: 7591
From what I understand, you are only asking how to verify if the checkbox is empty, right? This should do it:
<script type="text/javascript">
function ShowProgressBar() {
if (document.getElementById('<%=TextBox1.ClientID%>').value == "") {
document.getElementById('dvProgressBar').style.visibility = "hidden";
}
else {
document.getElementById('dvProgressBar').style.visibility = "visible";
}
}
</script>
Upvotes: 2
Reputation: 13600
Easiest way to do this is probably to use ajax
. Simply call a web service and use javascript to show a loading message/icon/whatever for the user. Try to use google for this, it's really straightforward.
It has to be asynchronous, or else it would block your UI and the please wait
wouldn't show.
Upvotes: 0