Posts

Showing posts with the label Javascript

Hide Text Fields and Drop down

_spBodyOnLoadFunctionNames.push("hideFields"); function findaTextControl(FieldName) { var arr = document.getElementsByTagName("input");    for (var i=0;i < arr.length; i++ )    {       if (arr[i].id.indexOf(FieldName) == 0)       {         return arr[i];      }    } } function findaSelectcontrol(FieldName) { var arr = document.getElementsByTagName("select");    for (var i=0;i < arr.length; i++ )    {       if (arr[i].id.indexOf(FieldName) == 0)       {         return arr[i];      }    } } function hideFields() { //debugger;    var control = findaSelectcontrol("TeamAssignedWorkFlow");    control.parentNode.parentNode.parentNode.style.display="none";     var control = findaSelectcontrol("St...

Disable the Anchor Tag Using JavaScript

function DisableTheAnchorTag() { var btnA= document.getElementById("name of the a tag"); if(btnA!= null) { btnA.onmouseover=function y(){this.style.cursor='default'} btnA.setAttribute('onclick', "void(0);"); } }

Getting Query parameters using Javascript

<script language='JavaScript'> // get the current URL var url = window.location.toString(); //get the parameters url.match(/\?(.+)$/); var params = RegExp.$1; // split up the query string and store in an // associative array var params = params.split("&"); var queryStringList = {}; for(var i=0;i { var tmp = params[i].split("="); queryStringList[tmp[0]] = unescape(tmp[1]); } // print all querystring in key value pairs for(var i in queryStringList) document.write(i+" = "+queryStringList[i]+"<br/>"); </script>

how to raise button on click event in aps code behind?

Here is a simple sample I think that does what you want it to do: html xmlns= "http://www.w3.org/1999/xhtml" > script runat= "server" > protected void popbtn_Click(object sender, EventArgs e) { Page.ClientScript.RegisterClientScriptBlock(typeof(string), "Popup", "window.alert(\"" + inputtxtbx.Text + "\");", true); } script > head runat= "server" > title >Page title > head > body > form action= "default.aspx" runat= "server" > asp:TextBox ID= "inputtxtbx" runat= "server" /> asp:Button ID= "popbtn" runat= "server" Text= "Show Popup" OnClick= "popbtn_Click" /> form > body > html >