MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

mv3.10 [if-field] nesting bug



The following code works:

[if-field color]
<FORM ACTION="[process-target]" METHOD=POST>
<TABLE BORDER=1 CELLPADDING=5 BORDERCOLOR="black"><TR><TD BGCOLOR="blue">
<FONT COLOR="white">Qty:<BR><INPUT SIZE=3 NAME=mv_order_quantity VALUE="1"
MAXLENGTH=3>
</TD><TD BGCOLOR="blue">
<FONT COLOR="white">Color:<BR>[item-accessories color]<BR>
</TD>
<TD BGCOLOR="blue"><INPUT TYPE=image BORDER=0 SRC="buy.gif" VALUE="(ORDER
NOW)">
<INPUT TYPE=hidden NAME=mv_todo VALUE=refresh>
<INPUT TYPE=hidden NAME=mv_order_item VALUE="[item-code]">
<INPUT TYPE=hidden NAME=mv_separate_items VALUE="1">
</TD></TR></TABLE></FORM>
[else]
[order [item-code]]<IMG BORDER=0 SRC="buy.gif" ALT="(ORDER NOW)">[/order]<BR>
[/else]
[/if-field]

If there is a color field, a qty field and a pulldown is generated.  Else,
just the buy buttong is displayed.

Bug:

[if-field color]
<FORM ACTION="[process-target]" METHOD=POST>
<TABLE BORDER=1 CELLPADDING=5 BORDERCOLOR="black"><TR><TD BGCOLOR="blue">
<FONT COLOR="white">Qty:<BR><INPUT SIZE=3 NAME=mv_order_quantity VALUE="1"
MAXLENGTH=3>
</TD><TD BGCOLOR="blue">
<FONT COLOR="white">Color:<BR>[item-accessories color]<BR>
</TD>
<!-- added this: -->
[if-field option6]<TD BGCOLOR="blue"><FONT COLOR="white">Bag 2
Color:<BR>[item-accessories option6]<BR></TD>[/if-field]
<!--- end -->
<TD BGCOLOR="blue"><INPUT TYPE=image BORDER=0 SRC="buy.gif" VALUE="(ORDER
NOW)">
<INPUT TYPE=hidden NAME=mv_todo VALUE=refresh>
<INPUT TYPE=hidden NAME=mv_order_item VALUE="[item-code]">
<INPUT TYPE=hidden NAME=mv_separate_items VALUE="1">
</TD></TR></TABLE></FORM>
[else]
[order [item-code]]<IMG BORDER=0 SRC="buy.gif" ALT="(ORDER NOW)">[/order]<BR>
[/else]
[/if-field]

[If field option6] does not exist the [if-field color] also fails and the
[else] is returned.

So, as best as I can test it seems that you cannot nest [if-fields] with an
[else] present.  It is interpretted as an 'AND' when an [if-field] is used
inside another.

I can work around it, I hope.

Ryan Hertz                                              tel  520-645-3812
Webmaster                                               tel  800-645-BAIT
Advertising Director                                    fax  520-645-2588
Gary Yamamoto Custom Baits, Inc.            http://www.yamamoto.baits.com


Search for: Match: Format: Sort by: