<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9125929655259760087</id><updated>2011-11-28T09:39:15.903+05:30</updated><category term='what is the newline char for alert message'/><category term='Ajax'/><title type='text'>Lamens Javascript</title><subtitle type='html'>Lamens Tutorial in simple Layman's Terms</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lamens1javascript.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9125929655259760087/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lamens1javascript.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mathi</name><uri>http://www.blogger.com/profile/03979427407848755119</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9125929655259760087.post-7391538849034771822</id><published>2008-07-29T20:41:00.011+05:30</published><updated>2008-08-01T12:26:46.953+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'></title><content type='html'>&lt;div class="qnans"&gt; 
  &lt;h1&gt;
     Only after something is typed inside the textbox,
     The button should be enabled.
&lt;a href="http://4.bp.blogspot.com/_Z1RigC4qQAE/SI8znjN8CdI/AAAAAAAAARg/nIxk-b35C60/s1600-h/enableButton.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_Z1RigC4qQAE/SI8znjN8CdI/AAAAAAAAARg/nIxk-b35C60/s400/enableButton.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5228454446962051538" /&gt;&lt;/a&gt;
  &lt;/h1&gt;
  &lt;h2&gt;
   Copy the following code in the notepad and save it as test.htm
   and then run it.
   &lt;br&gt;
   &lt;textarea cols="90" rows="15" style="font-size:10px;font-family:arial"&gt;
&lt;form name="form1"&gt;
&lt;input type="text" name="iserod" id="userid" onKeyUp="enableBn1();"/&gt;
&lt;input id="button1" type="button" disabled="disabled" value="Button1"&gt;
&lt;/form&gt;
&lt;script&gt;
function enableBn1(){
  if(document.form1.userid == ""){
  document.form1.button1.disabled = true;
  }
  else{
  document.form1.button1.disabled = false;
  }
}
&lt;/script&gt;
   &lt;/textarea&gt;
  &lt;/h2&gt;
&lt;/div&gt;




&lt;div class="qnans"&gt;
   &lt;h1&gt;
      Ajax code for Check Availability of User ID
   &lt;/h1&gt;
   &lt;h2&gt;
   
   &lt;textarea cols="90" rows="40" style="font-size:10px;font-family:arial"&gt;
   &lt;form name="form1"&gt;
&lt;input type="text" name="userid" id="userid" /&gt;
&lt;input id="button1" type="button" value="check availability" onclick="sendLamens();"&gt;
&lt;/form&gt;
&lt;div id="label1"&gt;&lt;/div&gt;
&lt;script&gt;
function sendLamens(){
 if(window.XMLHttpRequest) {
   lamens = new XMLHttpRequest();
 }
 else if(window.ActiveXObject){
   lamens = new ActiveXObject("Microsoft.XMLHTTP");
 }
 lamens.open("POST", "test1.asp", true);
 lamens.onreadystatechange = fetchFromLamens;
 lamens.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 lamens.send("userid=" + document.form1.userid.value);
}
function fetchFromLamens(){
 if(lamens.readyState == 4){ 
  if(lamens.status == 200){
  document.getElementById("label1").innerHTML = lamens.responseText;
  }
  else{
  document.getElementById("label1").innerHTML = "error";
  }
  }
}
&lt;/script&gt;
&lt;!--
The readyState propery is used to know whether the reply from the web server has been received or not.
:

0 : uninitialized 
1 : loading 
2 :loaded 
3 : interactive 
4 : completed 
Suppose, the client has received the reply. If the reply is OK then it is 200,and if the received reply is error message then it is 404

The OPEN method sets the different values such as the type of request(GET or POST), the URL, if it is asynchronous(true) or synchronouse(false).


--&gt;

   &lt;/textarea&gt;
&lt;/h2&gt;

&lt;textarea cols="90" rows="40" style="font-size:10px;font-family:arial"&gt;
&lt;%
x=Request("userid")
If x="lamens" Then
  Response.Write("Yah!Lamens is available")
Else
  Response.write("Why dont you try lamens")
End If
%&gt;

&lt;/textarea&gt;

&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9125929655259760087-7391538849034771822?l=lamens1javascript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9125929655259760087/posts/default/7391538849034771822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9125929655259760087/posts/default/7391538849034771822'/><link rel='alternate' type='text/html' href='http://lamens1javascript.blogspot.com/2008/07/only-after-something-is-typed-inside.html' title=''/><author><name>Mathi</name><uri>http://www.blogger.com/profile/03979427407848755119</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Z1RigC4qQAE/SI8znjN8CdI/AAAAAAAAARg/nIxk-b35C60/s72-c/enableButton.gif' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-9125929655259760087.post-8812207065904322949</id><published>2008-06-30T16:59:00.034+05:30</published><updated>2008-07-18T20:52:09.395+05:30</updated><title type='text'></title><content type='html'>&lt;table style="background-color:#ff0000;color:#ffffff;font-family:'trebuchet ms',arial;font-size:12px;font-weight:bold"&gt;
&lt;tr&gt;
&lt;td&gt;
The Textbox should accept ONLY NUMBERS
&lt;br&gt;

&lt;div id="sh_only_numbers" style="display:block"&gt;
&lt;a style="text-align:right;text-decoration:underline;color:blue;font-weight:bold;font-size:14px;" href="#" onclick="only_numbers.style.display='block';"&gt;Show The Code
&lt;/a&gt;
&lt;div&gt;

&lt;div style="background-color:#000000;font-weight:normal;border-bottom:3px solid #ffffff;display:none" id="only_numbers"&gt;
Copy the html given here and paste in notepad and save as test.htm
&lt;br&gt;
in your desktop and double click on the file. It will accept only numbers.
&lt;br&gt;
Here keyCode 48 to 57 is A to Z, 95 to 105 is a to z
&lt;br&gt;
&lt;textarea name="dummy_textarea" cols="50" rows="25"&gt;
 &lt;html&gt;
&lt;head&gt;
&lt;script&gt;
function chkNum()
{
if(
    (event.keyCode &gt;= 48 &amp;&amp; event.keyCode &lt;= 57)
    || 
    (event.keyCode &gt;= 96 &amp;&amp; event.keyCode &lt;= 105)
   ) {
      return true;
}
else {
      return false;
}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form&gt;
Enter Your Age :
&lt;input type="text" name="age" onkeydown="return chkNum()"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/textarea&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;table&gt;

&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;













&lt;table style="background-color:#ff0000;color:#ffffff;font-family:'trebuchet ms',arial;font-size:12px;font-weight:bold"&gt;
&lt;tr&gt;
&lt;td&gt;
The Textbox should accept ONLY UPPER CASE
&lt;br&gt;


&lt;a style="text-align:right;text-decoration:underline;color:blue;font-weight:bold;font-size:14px;" href="#" onclick="only_upper.style.display='block';"&gt;Show The Code
&lt;/a&gt;


&lt;div style="background-color:#000000;font-weight:normal;border-bottom:3px solid #ffffff;display:none" id="only_upper"&gt;Copy the html given here and paste in notepad and save as test.htm
&lt;br&gt;
in your desktop and double click on the file. It will accept only numbers.
&lt;br&gt;
Here keyCode 48 to 57 is A to Z, 95 to 105 is a to z
&lt;br&gt;
&lt;textarea name="dummy_textarea" cols="50" rows="25"&gt;
 &lt;html&gt;
&lt;head&gt;
&lt;script&gt;


function chkUpper()
{
  if (
       event.keyCode &gt;= 65 
       &amp;&amp; 
       event.keyCode &lt;= 90) {
       return true;}
  else {
       return false;
       }
}


&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form&gt;
Enter Your Name (In Capital Letters) :
&lt;input type="text" name="age" onkeydown="return chkUpper()"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/textarea&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;













&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9125929655259760087-8812207065904322949?l=lamens1javascript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9125929655259760087/posts/default/8812207065904322949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9125929655259760087/posts/default/8812207065904322949'/><link rel='alternate' type='text/html' href='http://lamens1javascript.blogspot.com/2008/06/javascript-cheat-sheet.html' title=''/><author><name>Mathi</name><uri>http://www.blogger.com/profile/03979427407848755119</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-9125929655259760087.post-1788285237262117013</id><published>2008-06-29T17:05:00.001+05:30</published><updated>2008-06-30T17:31:20.626+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='what is the newline char for alert message'/><title type='text'></title><content type='html'>&lt;font color="#0066cc" face="arial" size="4"&gt;
&lt;strong&gt;
What is the newline character for alert message?
&lt;/strong&gt;
&lt;/font&gt;
&lt;font color="red" face="arial" size="4"&gt;
&lt;pre&gt;
&lt; script language="Javascript" &gt;
   alert("Hello\r\nMy Name is Preity");
&lt; /script &gt;
&lt;/pre&gt;
&lt;/font&gt;
&lt;font color="#a0a0a0" face="arial" size="2"&gt;
Note : In some browsers "\n" will work and some browers "\r\n" will work.
       For a safer side, always use "\r\n".
       Here r-stands for return, n-stands for new line.
&lt;/font&gt;














.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9125929655259760087-1788285237262117013?l=lamens1javascript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9125929655259760087/posts/default/1788285237262117013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9125929655259760087/posts/default/1788285237262117013'/><link rel='alternate' type='text/html' href='http://lamens1javascript.blogspot.com/2008/06/javascript-alert-message-newline-char.html' title=''/><author><name>Mathi</name><uri>http://www.blogger.com/profile/03979427407848755119</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
