Friday, June 26, 2009

Send HTML Form Elements Value Without Using Form Tag

How to send form components value without using Form Tag in HTML, ?
This example will help your to send HTML elements value from one page to another page without using HTML Form Tag.

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<script language="javascript">
function goFor(){
var ele = document.getElementById("URL");
if(ele.value==""){
alert("Please Enter URL.");
}else{
location.href="http://www.google.com?q="+ele.value;
}
}
</script>
<input id="URL" name="URL" type="text">
<input type="button" value="Go" onclick='goFor()'/>
</BODY>
</HTML>

No comments:

Post a Comment