[ic] order.profile - conditional expression - item-modifier
John Matecsa
interchange-users@icdevgroup.org
Thu Feb 27 23:56:00 2003
In order.profile how does one do a conditional expression on an
item-modifier?
In my attempt is below...
The first "if" never errors on invalid input. Neither does the second.
The third "if", inspired by a jewel discovered on the mail list, errors
when it should.
__NAME__ sap_selection
[item-list]
[if cgi [modifier-name employee_number_one]]
[modifier-name employee_number_one]=regex ^5[0-9]{4}$ "Invalid"
[/if]
[if cgi employee_number_two0]
employee_number_two0=regex ^5[0-9]{4}$ "Invalid employee_number_two"
[/if]
[/item-list]
[if cgi teststuff]
teststuff=regex ^5[0-9]{4}$ "Invalid teststuff"
[/if]
&fatal=yes
__END__
Here are the relevant snippets from checkout.html
[item-list modular=1]
...
<TD ALIGN=CENTER valign=top>
<b>[error name="[modifier-name employee_number_one]" std_label=" "
required=1]</b><br>
<INPUT TYPE=text NAME="[modifier-name employee_number_one]" SIZE=5>
</TD>
<TD ALIGN=CENTER valign=top>
<b>[error name="[modifier-name employee_number_two]" std_label=" "
required=1]</b><br>
<INPUT TYPE=text NAME="[modifier-name employee_number_two]" SIZE=5>
</TD>
...
[/item-list]
...
<td>
<b>[error name=teststuff std_label="[LC]Test Stuff English[fr_FR]Test
Stuff French[/fr_FR][/LC]:" required=1] </b><br>
<input type="text" name="teststuff"><br>
</td>
After checkout, the values are successfully stored in the orderline
table.
Thanks in advance for your consideration, and any suggestions.
--
John Matecsa <matecsaj@picassofish.com>
Picasso Fish Corporation