<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>form validation Archives -</title>
	<atom:link href="https://mitindia.in/tag/form-validation/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/form-validation/</link>
	<description></description>
	<lastBuildDate>Sat, 26 Nov 2016 07:28:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>form validation Archives -</title>
	<link>https://mitindia.in/tag/form-validation/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Javascript programs</title>
		<link>https://mitindia.in/javascript-programs/</link>
					<comments>https://mitindia.in/javascript-programs/#comments</comments>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Tue, 28 Jun 2016 06:42:57 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[color effect]]></category>
		<category><![CDATA[dhtml effects]]></category>
		<category><![CDATA[digital clock]]></category>
		<category><![CDATA[email validation]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[form validation]]></category>
		<category><![CDATA[javascript digital calculator]]></category>
		<category><![CDATA[length of string]]></category>
		<category><![CDATA[phone validation]]></category>
		<category><![CDATA[radio button demo]]></category>
		<category><![CDATA[string functions]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=181</guid>

					<description><![CDATA[<p>Java Script is an interpreted, object-based scripting language, developed by Sun Micro systems and Netscape.  JavaScript makes it easier to create interactive Web Pages.  Common Gateway Interface was considered as the standard for processing the forms. It was time consuming process because form validation used to take place on the server side.  JavaScript made the entire work easier by [&#8230;]</p>
<p>The post <a href="https://mitindia.in/javascript-programs/">Javascript programs</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Java Script is an interpreted, object-based scripting language, developed by Sun Micro systems and Netscape.  JavaScript makes it easier to create interactive Web Pages.  Common Gateway Interface was considered as the standard for processing the forms. It was time consuming process because form validation used to take place on the server side.  JavaScript made the entire work easier by validating the form at the client side.</p>
<p>List of Javascript programs are given below with output screenshots as well and you need to copy the code as an individual program and paste in Notepad then save with <em>.html</em> (<span style="color: #008000;">exa: mywebpage.html</span>) file extension and see output in the browser.</p>
<p><strong><span style="color: #333399;">1. Javascript Program to display DIGITAL CALCULATOR </span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/calc.png" alt="calc" /></p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;
function calc(ch)
{
if(ch=="=")
{
document.f1.t1.value=eval(document.f1.t1.value)
}
else
{
if(ch=="C")
{
document.f1.t1.value=""
}
else
{
document.f1.t1.value+=ch
}
}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt; DIGITAL CALCULATOR &lt;/h2&gt;
&lt;form name=f1&gt;
&lt;input type=text name=t1 size=24&gt; &lt;br&gt;
&lt;table border=2 cellspacing=6 cellpadding=6&gt;
&lt;tr&gt;
&lt;td&gt; &lt;input type=button value="7" onClick="calc('7')"&gt;
&lt;td&gt; &lt;input type=button value="8" onClick="calc('8')"&gt;
&lt;td&gt; &lt;input type=button value="9" onClick="calc('9')"&gt;
&lt;td&gt; &lt;input type=button value="*" onClick="calc('*')"&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;input type=button value="4" onClick="calc('4')"&gt;
&lt;td&gt; &lt;input type=button value="5" onClick="calc('5')"&gt;
&lt;td&gt; &lt;input type=button value="6" onClick="calc('6')"&gt;
&lt;td&gt; &lt;input type=button value="/" onClick="calc('/')"&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;input type=button value="1" onClick="calc('1')"&gt;
&lt;td&gt; &lt;input type=button value="2" onClick="calc('2')"&gt;
&lt;td&gt; &lt;input type=button value="3" onClick="calc('3')"&gt;
&lt;td&gt; &lt;input type=button value="-" onClick="calc('-')"&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;input type=button value="0" onClick="calc('0')"&gt;
&lt;td&gt; &lt;input type=button value="C" onClick="calc('C')"&gt;
&lt;td&gt; &lt;input type=button value="=" onClick="calc('=')"&gt;
&lt;td&gt; &lt;input type=button value="+" onClick="calc('+')"&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;h3&gt; by MIT India &lt;/h3&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">2. Automatic Background Color Change using[timer method] Javascript. </span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/backcolor.png?w=300" alt="backcolor" /></p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;
colours=new Array("red", "green", "blue", "yellow", "pink", "cyan")
index=0
function func()
{
if(index&gt;5)
{
index=0
document.bgColor=colours[index]
index++
}
else
{
document.bgColor=colours[index]
index++
}
}
function startbk()
{
ref=setInterval('func()', 1000)
}
function stopbk()
{
clearInterval(ref)
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;marquee&gt;&lt;h1&gt; Text Effect &lt;/h1&gt; &lt;/marquee&gt;
&lt;input type=button name=b1 value="Start" onClick='startbk()'&gt;
&lt;input type=button name=b2 value="Stop" onClick='stopbk()'&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">3. Digital CLOCK program using Javascript </span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/dc.png" alt="dc" /></p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;
function disp()
{
dt=new Date()
h=dt.getHours() % 12 || 12;
m=dt.getMinutes()
s=dt.getSeconds()
document.f1.t1.value=h
document.f1.t2.value=m
document.f1.t3.value=s
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script language="javascript"&gt;
setInterval('disp()', 1000)
&lt;/script&gt;
&lt;form name=f1&gt;
&lt;input type=text name=t1 size=2&gt;
&lt;input type=text name=t2 size=2&gt;
&lt;input type=text name=t3 size=2&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">4. File Open method using Javascript </span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/fileopen.png" alt="fileopen" /></p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;
function f5()
{
var op
op=open("dht.html")
}
function f2()
{
var op
op=open("js2.html")
}
function f3()
{
var op
op=open("js.html")
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt; File Open Method &lt;/h1&gt;
&lt;form name=f1&gt;
&lt;input type=button name=b1 value="File1" onClick='f5()'&gt;
&lt;input type=button name=b2 value="File2" onClick='f2()'&gt;
&lt;input type=button name=b3 value="File3" onClick='f3()'&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">5. Email and Phone number Validation using Javascript </span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/email.png?w=300" alt="email" /></p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;
function val()
{
var str, str2
str=document.f1.t1.value
str2=document.f1.t2.value
if (str2=="")
{
alert("Enter Phone number")
}
len=str.length
for(i=2; i&lt;len; i++)
{
if(str.charAt(i)=='@')
{ return true}
}
alert("Invalid EmailId")
return false
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt; Email and Phone Number Validation &lt;/h1&gt;
&lt;form name=f1&gt;
Enter Email ID &lt;input type=text name=t1&gt; &lt;br&gt;
Enter Phone: &lt;input type=text name=t2&gt; &lt;br&gt;
&lt;input type=button name=b1 value="Check" onClick='val()'&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">6. All arithmetic  operation program using javascript</span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/aop.png" alt="aop" /></p>
<pre>&lt;html&gt; 
&lt;head&gt;
&lt;title&gt; Using loop &lt;/title&gt;
&lt;script language="javascript"&gt;
function add()
{
document.f1.t3.value=parseInt(document.f1.t1.value)+parseI
nt(document.f1.t2.value)
}
function sub()
{
document.f1.t3.value=parseInt(document.f1.t1.value)-parseIn
t(document.f1.t2.value)
}
function mul()
{
document.f1.t3.value=parseInt(document.f1.t1.value)*parseIn
t(document.f1.t2.value)
}
function div()
{
document.f1.t3.value=parseInt(document.f1.t1.value)/parseIn
t(document.f1.t2.value)
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 align="center"&gt; Simple Form &lt;/h1&gt; &lt;hr&gt;
&lt;form name=f1&gt;
&lt;table&gt;
&lt;tr&gt; &lt;td&gt;Enter Num1: &lt;/td&gt; &lt;td&gt;&lt;input type=text
name=t1&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Enter Num2: &lt;/td&gt; &lt;td&gt;&lt;input type=text
name=t2&gt; &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Result: &lt;/td&gt; &lt;td&gt;&lt;input type=text name=t3&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt; &lt;input type=button name=b1 value="Add"
onClick='add()'&gt;
&lt;input type=button name=b2 value="Subtract"
onClick='sub()'&gt; &lt;/td&gt;
&lt;td&gt;
&lt;input type=button name=b3 value="Multiplication"
onClick='mul()'&gt;
&lt;input type=button name=b4 value="Division"
onClick='div()'&gt;
&lt;input type=reset name=b5 value="Reset"&gt; &lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">7. Radio button and check box demo program</span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/rc.png" alt="rc" /></p>
<pre>&lt;html&gt;
&lt;body&gt;
&lt;h1 align=center&gt; Using Checkbox and Radio Buttons &lt;/h1&gt;
&lt;hr&gt;
&lt;h4&gt; Hobbies &lt;/h4&gt;
&lt;form name=f1&gt;
&lt;input type=checkbox name=c1 value=music&gt; Music &lt;br&gt;
&lt;input type=checkbox name=c2 value=read&gt; Reading &lt;br&gt;
&lt;input type=checkbox name=c3 value=watchtv&gt; Watching TV
&lt;br&gt;
&lt;hr&gt;
&lt;h4&gt; Mode of Payment &lt;/h4&gt;
&lt;input type=radio name=r1 value=mop&gt; Cash &lt;br&gt;
&lt;input type=radio name=r1 value=mop&gt; Credit &lt;br&gt;
&lt;hr&gt;
&lt;input type=button name=b1 value="Submit"&gt;
&lt;input type=button name=b2 value="Cancel"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>8. A Web Program on DHTML Effects </strong></p>
<p><img fetchpriority="high" decoding="async" class="alignnone" src="https://shivkblog.files.wordpress.com/2015/06/dht.png" alt="dht" width="234" height="289" /></p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Using DHTML &lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Using DHTML &lt;/h1&gt;
&lt;p&gt; &lt;marquee behavior=scroll direction=right scrollamount=3&gt; This is sample DHTML text effect &lt;/marquee&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt; &lt;marquee behavior=scroll direction=up scrollamount=3&gt; This is sample DHTML text effect &lt;/marquee&gt; &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt; &lt;marquee behavior=scroll direction=down scrollamount=3&gt; This is sample DHTML text effect &lt;/marquee&gt; &lt;/p&gt;
&lt;h1 onMouseOver='this.style.color="red"'&gt; Place here mouse cursor here &lt;/h1&gt;
&lt;h1 onClick='this.style.color="blue"'&gt; Place here mouse cursor here &lt;/h1&gt;
&lt;h1 onDblClick='this.style.color="Green"'&gt; Place here mouse cursor here &lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">9. Find length of the entered STRING</span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/los.png" alt="los" /></p>
<pre>&lt;html&gt;
&lt;body&gt;
&lt;script language="javascript"&gt;
var len, str
str=prompt("Enter any string")
len=str.length
document.write("total no of characters in the string:"+len)
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong><span style="color: #000080;">10. String Functions program on Javascript</span></strong></p>
<p><img decoding="async" src="https://shivkblog.files.wordpress.com/2015/06/sf.png" alt="sf" /></p>
<pre>&lt;html&gt;
&lt;body&gt;
&lt;script language="javascript"&gt;
var str,str2,str3
str=prompt("Enter any string")
str2=str.toUpperCase()
document.write("&lt;h1&gt;"+"String Functions"+"&lt;/h1&gt;")
document.write("Upper case string is :"+ str2)
document.write("&lt;br&gt;")
str3=str.toLowerCase()
document.write("Lower case string is :"+ str3)
document.write("&lt;br&gt;")
arr=new Array(1,2,3,4,5)
document.write("Reverse array is :"+arr.reverse())
document.write("&lt;br&gt;")
arr2=new Array(1,5,2,3,4)
document.write("Sorted array is :"+arr2.sort())
document.write("&lt;br&gt;")
arr3=new Array(1,5,2,3,4)
document.write("separator is :"+arr3.join('*'))
document.write("&lt;br&gt;")
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>&nbsp;</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fjavascript-programs%2F&amp;linkname=Javascript%20programs" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fjavascript-programs%2F&amp;linkname=Javascript%20programs" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fjavascript-programs%2F&#038;title=Javascript%20programs" data-a2a-url="https://mitindia.in/javascript-programs/" data-a2a-title="Javascript programs"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/javascript-programs/">Javascript programs</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mitindia.in/javascript-programs/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
