Page 1 of 1
Simple text on google.com
Posted: Sun Jan 10, 2010 9:33 am
by kapil1089theking
Code: Select all
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
When I press Submit, I want to get the text from text field and open
http://www.google.com with text field content as this page's text.
How to do that?
Re: Simple text on google.com
Posted: Sun Jan 10, 2010 9:36 am
by jayshields
As far as I'm aware, you can't.
You can however make your submit button emulate Google's submit button as if the text was in their text box?
http://www.google.com/search?q=your+text
Re: Simple text on google.com
Posted: Sun Jan 10, 2010 10:53 am
by agriz
Code: Select all
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function doGoogle()
{
val = document.forms[0].q.value;
document.forms[0].action = 'http://www.google.com/search?q='+val;
document.forms[0].target = "_blank";
}
</script>
</head>
<body>
<form name="form1" method="get">
<input type="text" name="q">
<input type="submit" name="btnG" value="Google Search" onClick="doGoogle()">
</form>
</body>
</html>
Re: Simple text on google.com
Posted: Mon Jan 11, 2010 3:48 am
by kapil1089theking
what if i want to get this value from 1st form to first name of
http://www.magicjack.com/8/step2.asp
I am unable to do the same