Akopia Akopia Services

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

Re: [mv] Need help with perl P L E A S E



******    message to minivend-users from "kyle@invisio.com" <kyle@invisio.com>     ******

I'm not quite sure what you are trying to do, but maybe this
will help. (untested though)

1st in mv tags:

<select name="[quantity-name]">
[loop arg="1 2 3 4 5"]
<option value="[loop-code]"[if '[item-quantity]' eq '[loop-code]']
selected[/if]>[loop-code]
[/loop]
</select>

2nd in mostly perl:

<select name=[quantity-name]>
[perl interpolate=1]
my ($return, $myvar);
my $item_quntity = '[item-quantity]' ;
for($myvar = 1; $myvar < 6; $myvar++) {
	$return .= "<option value=$myvar";
	if ($myvar eq $item_quantity) {
		$return .= " selected>$myvar\n";
	}
	else {
		$return .= ">$myvar\n";
	}
}
return $return;
}
[/perl]
</select>

I assume no liability of any sort resulting out of the use
of the above code, including but not limited to computer
crash, bodily injury or loss of hair :-)

Kyle Cook (KC)


At 10:09 PM 2/7/00 -0600, you wrote:
>******    message to minivend-users from "Stan Crump" <stanc@amintech.com>   
>  ******
>
>I know this will show how little I know about using perl with MV, but I'm
>desperate for some help...
>
>I thought that:
>-- snip --
><select name=[quantity-name] value=[item-quantity]>
>[perl interpolate=1]
>$myvar = 1;
>while ( $myvar <= 5 ) {
>print "<option value=$myvar [if explicit][condition] [item-quantity] ==
>$myvar;[/condition] selected [/if]> $myvar\n";
>$myvar = ( $myvar + 1 );
>}
>[/perl]
></select>
>-- snip --
>
>would output HTML:
><select name=quantity0 value=1>
><option value=1 [if explicit][condition][item-quantity] == 1;[/condition]
>selected [/if]>1
>... etc ...
><option value=5 [if explicit][condition][item-quantity] == 5;[/condition]
>selected [/if]>5
></select>
>
>instead, the HTML output is:
><select name=quantity0 value=1>
>
></select>
>
>Can any one please help me get back on track with this?
>
>
>Thanks!
>Stan Crump
>-
>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

-
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


Search for: Match: Format: Sort by: