Real Estate Forums

Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here.

Reply
 
Thread Tools Display Modes
Old 04-06-2008, 03:35 PM
Dj's Avatar
Dj Dj is offline
Advanced Webmaster
 
Join Date: Nov 2005
Location: Tampa Bay Area, Florida
Posts: 1,071
Dj is on a distinguished road
Default Form Code Question for Search Box

Okay, I'm stumped. Here's what I have so far and it works just fine, searches ONLY "mysite" for keywords. But, I don't want the radio button or the text after it "Subdivisions". Just want the input box and the search button and of course to only search my site. Everytime I mess with the code, it stops searching only "mysite" and goes to google and gets everything. Can any of you coders out there help? Thanks so much!

<form method="get" action="http://www.google.com/search">
<input type="text" name="q" size="31" maxlength="155" value="" />
<input type="submit" value="Search" />
<input type="radio" name="sitesearch" value="mysite.com" checked /> Subdivisions<br />
</form>
Reply With Quote
Old 04-24-2008, 11:42 AM
RS305 RS305 is offline
New real estate webmaster
 
Join Date: Mar 2008
Location: Miami, FL
Posts: 17
RS305 is on a distinguished road
Default Re: Form Code Question for Search Box

change this line:

<input type="radio" name="sitesearch" value="mysite.com" checked /> Subdivisions<br />

to this:

<input type="hidden" name="sitesearch" value="mysite.com" />
__________________
SellFoN.com | Webinars & Tutorials
Lead Generation and Marketing for Real Estate Professionals
Reply With Quote
Old 04-24-2008, 12:12 PM
Dj's Avatar
Dj Dj is offline
Advanced Webmaster
 
Join Date: Nov 2005
Location: Tampa Bay Area, Florida
Posts: 1,071
Dj is on a distinguished road
Default Re: Form Code Question for Search Box

Thank you! I had just about given up. Another question for you if you know and don't mind. Is there a way to get the search results to pop a new page so the user doesn't lose the original page?

The only problem I have with this search is that google paid ads are there along with my results. But, it's still good for me to have this.
Reply With Quote
Old 04-24-2008, 01:05 PM
RS305 RS305 is offline
New real estate webmaster
 
Join Date: Mar 2008
Location: Miami, FL
Posts: 17
RS305 is on a distinguished road
Default Re: Form Code Question for Search Box

this should do it. not sure if popup blockers will complain about the JavaScript window.open stuff (i don't use popup blockers, so please test this).

Code:
<script type="text/javascript">
function doSearch()
{
	var frm = document.forms.search;
	var q = escape( frm.q.value );
	var site = frm.sitesearch.value;
	var url = "http://www.google.com/search?q=" + q + "&sitesearch=" + site;
	window.open( url );
}
</script>
<form name="search">
<input type="text" name="q" size="31" maxlength="155" value="" />
<input type="button" onclick="doSearch()" value="Search" />
<input type="hidden" name="sitesearch" value="mysite.com" />
</form>
__________________
SellFoN.com | Webinars & Tutorials
Lead Generation and Marketing for Real Estate Professionals
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
page error - snippet form code issue mitch.argon REW CMS 1 Questions 2 09-14-2007 10:10 AM
simple form question RESynergy Coding 5 06-04-2007 11:11 AM
Zip code, area code validation database.... tracedef Coding 2 04-17-2007 08:26 PM
PHP form problem RESynergy Coding 1 02-22-2007 09:41 PM
The Million Dollar Question on Link Request Form Software Bob Crain Linking Strategies 2 08-09-2005 08:32 PM

REW Conference

For our members

Main Sections

IDX Coverage Areas

Spiders Welcome

All times are GMT -7. The time now is 03:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.