[ic] In page search

Curt Hauge interchange-users@icdevgroup.org
Thu Nov 14 12:14:00 2002


Walter de Kok wrote:

> I have an arbitrary database called 'compat' which has four field: sku,
> name, sku2, name2.
> What I would like to do is the following:
>
> On 1 page I would like to have a search field in which one can fill in a
> string. This string has to be looked up in the column 'name' en has to
> return the fields sku2, name2, on the same page as the search field.
>
> Is this possible????

Yes

> Thanks for any tips or hints....

I would try something like:

[search-region]

<FORM ACTION="[area name_of_this_page]" METHOD=POST>
<input type=hidden name=mv_session_id value="[data session id]">
<INPUT TYPE="hidden" SIZE="30" NAME="mv_search_file" VALUE=compat>
<INPUT TYPE="hidden" SIZE="30" NAME="mv_matchlimit" VALUE="9999">
<INPUT TYPE="hidden" SIZE="30" NAME="mv_sort_field" VALUE="sku2">
<INPUT TYPE="hidden" SIZE="30" NAME="mv_search_field" VALUE="name">

<INPUT TYPE="text" SIZE="30" NAME="mv_searchspec">
<INPUT TYPE="submit" VALUE="Search">

</FORM>
[search-list]

[item-data compat sku2] - [item-data compat name2]<br>

[/search-list]

[no-match]
<BR><BR><BLOCKQUOTE>
<font __FFACE__ size="2">
Sorry, no matches for <B>[calc]
			my $joiner = ' AND ';
			$joiner = ' OR ' if
					defined $Search->{''}->{mv_orsearch}[0]
					and $Search->{''}->{mv_orsearch}[0];
			my @str = grep /\D/, @{$Values->{mv_searchspec}};
			return join $joiner, @str;
			[/calc]
[if value mv_search_error]
<P><B>Errors:
<BR> [value-extended name=mv_search_error joiner="<BR>"]
</B>
[/if]
</font>
<BR><BR></BLOCKQUOTE>
[/no-match]
<font __FFACE__ size="2">
<BR CLEAR=LEFT>
[more-list]
</font>
<BLOCKQUOTE>
<font __FFACE__ size="2">
Matches [matches] of [match-count] found.
<BR>[more]<BR>
</font>
</BLOCKQUOTE>
[/more-list]

[/search-region]


Not tested, and it may not have desirable results if you call the page
without a search string.

Good luck!

Curt Hauge

//////////////////////////////////////////////////////////////////
// Web Design - Interchange Hosting - Small Business Consulting //
// 1525 Meadowwood Drive                    www.mnwebdesign.com //
// Brooklyn Park, MN 55444             www.iwantaconsultant.com //
// Phone 612-598-5530                      info@mnwebdesign.com //
//////////////////////////////////////////////////////////////////