[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] mv_searchspec
****** message to minivend-users from "Brent Worley" <brent@12ave.com> ******
How does minivend build up the mv_searchspec variable? What I am doing is
combing multiple arguments over a series of pages via javascript and
extracting them via perl. The javascript takes arguments from the first
page (which is the manufacturer list in the database) and combines it with
two values from two different select boxes. All this is passed to a third
page which then adds on the style and a value from a another select box.
The last page this completed argument and forms a select box based on the
previous arguemnts and passes all the information to the order page. To
build the box I used perl to abstract (or so I thought) each argument and
set them in an array. I then did a pattern match within a javascript
function and dumped the matched fieled into a select box. One problem with
this: The js function comes up blank and returns an error. I've tried to
different seperation of arguments. One using " " as a divider, the other
using "|" (this is how a no match available apears on the minivend default
page.) Am I on the right track, or is it seperated differently. Below I
have include portions of the source code from the various pages.
// This comes from the second page (in sequential order).
// Sansabelt is the manufacturer. This function is implemented onSubmit.
function SetArgs()
{
var frm = document.mv_value;
frm.mv_searchspec.value = "Sansabelt" + " " + frm.waist.value + " " +
frm.stride.value;
}
// This comes from the third page. When I tested the syntax above it
worked.
// So I implemented it on this page.
function SetArgs()
{
var frm = document.search
frm.mv_searchspec.value = frm.mv_searchspec.value + " " +
frm.fabrics.value;
}
// This is from the final page before submitting to the order page. I
thought this would seperate
// the [data session arg] tag, but it doesn't. In the page itself I cannot
any of these scratch
// variables to display.
[perl scratch]
my $arg = &tag_data('session', 'arg');
my @a = split("|", $arg);
$Safe{'scratch'}{'Manuf'} = @a[0];
$Safe{'scratch'}{'Waist'} = @a[1];
$Safe{'scratch'}{'Stride'} = @a[2];
$Safe{'scratch'}{'Model'} = @a[3];
$Safe{'scratch'}{'Fabric'} = @a[4];
[/perl]
The javascript after this is not hard to implement, but when the rest of the
string building fails, it get a little difficult to test the function. If
anyone knows how minivend builds a mv_searchspec string and/or has done
something like this before, I would really appreciate a response.
Brent Worley
-
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