Java Script function to show/hide a text box by clicking on a Radio Button

function ShowHide(msg, destinatinid) {
var tmpD;
var phc;
var phcDDL;

tmpD = document.getElementById(destinatinid);
if (msg == ‘No’)
tmpD.style.display = “none”;
if (msg == ‘Yes’)
tmpD.style.display = “”;
}

Adding this function to onclick java script function in C#

this.rbCAPNo.Attributes.Add(“onclick”, “ShowHide(‘No’, ‘” + tbCAPDetails.ClientID + “‘)”);
this.rbCAPYes.Attributes.Add(“onclick”, “ShowHide(‘Yes’, ‘” + tbCAPDetails.ClientID + “‘)”);

This entry was posted in Transact-SQL. Bookmark the permalink.

Leave a comment