PDA

View Full Version : Secret Word Search box



ATI
Jan 6th, 2011, 07:57 AM
ok what i would like to do is have a search box that searches google.

But when a secret word is entered they aren't taken to the google results page instead they are taken to a page of my choosing.

Is this possible, so a search box that searches google until a secret word is entered.


<html>
<form method="get" action="http://www.google.com/search">

<input type="text" name="q" size="31"
maxlength="255" value="" />
<input type="submit" value="Google Search" />


</form>
</html>

That is what i have so far. All it does is searches google so i need help adding the secret word bit.

thanks for you help.

Nile
Jan 6th, 2011, 01:53 PM
<html>
<form method="get" action="http://www.google.com/search" onsubmit="if(this.elements['q'].value == 'cake'){ this.action = 'http://yahoo.com'; }">

<input type="text" name="q" size="31"
maxlength="255" value="" />
<input type="submit" value="Google Search" />


</form>
</html>