[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Problem with HTML-based SQL-Query
****** message to minivend-users from Dan Busarow <dan@dpcsys.com> ******
On Thu, 20 Apr 2000, Thomas Hecker wrote:
> I have a Problem with Minivend 3.14-3 . I want to perform an sql-query using
> drop-down menus. The whole thing works fine as long as I specify either both
> options or just the first (subcategory), leaving the manufacturer on its
> default to show all manufacturers.
> But when I try to perform a query specifying just the manucturer, I get no
> match.
>
> I've tried to change the mv_coordinate value to "no" but it doesn't seem to
> have an effect.
>
> Here's the code:
>
> <FORM ACTION="[process-search]" METHOD=POST target="fenster">
> <INPUT TYPE="hidden" NAME="mv_searchtype" VALUE="sql">
>
> <INPUT TYPE="hidden" NAME="mv_coordinate" VALUE="yes">
> <INPUT TYPE=hidden NAME=mv_search_field VALUE=subcategory>
> <INPUT TYPE=hidden NAME=mv_search_field VALUE=manufacturer>
>
> Artikelart:<select size="1" name="mv_searchspec">
> <option value="" selected>alle</option>
> <option value="aps">APS-Kameras</option>
> <option value="digital">Digitalkameras</option>
> <option value="B1">Spiegelreflex</option>
> <option value="B2">Sucherkameras</option>
> </select>
We use Javascript for this type of search. Pretty sure the consensus
is that it's the only way to do this with SQL.
Here's a sample based on code posted here several months back.
<script language="javascript">
<!--
function scanUrl(form) {
var str = "/cgi-bin/ral/scan/fi=models/st=sql/co=yes/su=no/ml=20";
if (form.catselect.selectedIndex != 0) {
var i = form.catselect.selectedIndex;
var scText = escape(form.catselect.options[i].value);
str += "/sf=category/se=" + scText;
}
if (form.manselect.selectedIndex != 0) {
var i = form.manselect.selectedIndex;
var smText = escape(form.manselect.options[i].value);
str += "/sf=manufacturer/se=" + smText;
}
str += "/rf=code,manufacturer,name,description";
location = str;
}
//-->
</script>
catselect and manselect are the name= for the <select>
Just have your search button do an onClick="scanUrl(form_name)"
Dan
--
Dan Busarow 949 443 4172
Dana Point Communications, Inc. dan@dpcsys.com
Dana Point, California 83 09 EF 59 E0 11 89 B4 8D 09 DB FD E1 DD 0C 82
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list