Please ensure Javascript is enabled for purposes of website accessibility

Advanced Implementation

How to build a “quick search” form on another page

There are many ways to do this, and each way requires some amount of server-side or client-side code. If you don’t understand what is in this answer, please contact your webmaster. HIS recommends that you use GET to construct the iframe/frame SRC URL.

The starting page will have a form that looks like this:
<form action="YourFilePath" method="GET">
<input type="hidden" name="quicksearch" value="true"/><br>
<!--this hidden field will tell the destination URL that you are about to give it some values-->
<!--YOUR FORM HERE. see below for available field names and values.-->
</form>

 

This is what the PHP on the destination page may look like
<?php
$idxid = 'YOURIDXID';
$island = 4;
//4 is kauai, 3 is big island, 2 is maui, 1 is oahu.
$idxurl = 'http://idx.hawaiiinformation.com/search?idxid='.$idxid;
$detailsurl = 'http://idx.hawaiiinformation.com/details?idxid='.$idxid;
$qstring = $_SERVER['QUERY_STRING'];
if ($_GET['src']=='linkdetail')
//use this in your link's URL to specify that you're looking for detail page
{$idxurl = $detailsurl.'&'.$qstring;}
elseif ($_GET['quicksearch']=='true')
//use this in your link's URL to specify that you'd like to run a query
{$idxurl = $idxurl.'&'.$qstring;$title="Quick Search Results";}
else
//the default. This will display the default IDX URL specified above
{$idxurl = $idxurl.'&island='.$island;}
?>
<iframe src="<?php echo $idxurl;?>" frameborder=0 width=100% height=3500px onload="window.scrollTo(0, 0);"></iframe>

You can do something similar with javascript if you only have client side access.

<script>

function loadidx(idxid,island)

{

//coming soon

}

</script>

<iframe src=”” id=”the_iframe” width=”100%” height=”3000px” frameborder=”0″

onload=”window.scrollTo(0, 0);loadidx(‘YOURIDXID’,4)”></iframe>

IMPORTANT NOTE

You’ll notice that in the <iframe> above, the src is blank and the function “loadidx()” has two values. the first is the IDXID given to you by HIS, the other is your preferred island.

1 for Oahu. 2 for Maui. 3 for Big Island. 4 for Kauai. 0 for all islands.