Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
JavaScript
<script type="text/javascript">
      function DoCancel() {
          var txtCourierNo = document.getElementById("txtCourierNo");
          var Reason = document.getElementById("txtReason")
          var btnreject = document.getElementById("btnreject");
          var btnCourier = document.getElementById("btnCourier");
         
          if (btnreject.visible==true) {
              Reason.value = "";
          }
          else if (btnCourier.visible==true) {
              txtCourierNo.value = "";
          }
          
          
          
      }

    </script>
Posted
Updated 17-Oct-14 3:27am
v2

try this
btnCourier.style.visibility


or
(btnCourier.style.display == "none")
{
txtCourierNo.value = "";
}
else
Reason.value = "";


for detail this link can be usefull
http://stackoverflow.com/questions/7998060/asp-net-button-visibility-using-javascript[^]
 
Share this answer
 
v2
Check out the w3cschool reference:
http://www.w3schools.com/jsref/prop_style_visibility.asp[^]

Also, check out jquery! Easy to learn and will make your life a lot easier :-)
http://jquery.com/[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900