Mailing List Archive

Using [if]
This is a multi-part message in MIME format.

------=_NextPart_000_0035_01C07563.43591EA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Please forgive my ignorance, but I've been trying to get the following =
snippet of code working for the past 3 days with no success. I'm simply =
try to set an <option> to selected in a loop. Here is the snippet of =
code:

[list]
[if value [value-extended name=3D"mv_searchspec" index=3D"0"] eq =
[loop-code]]
<OPTION selected VALUE=3D"[loop-code]">[loop-pos 1]
[else]
<OPTION VALUE=3D"[loop-code]">[loop-pos 1]
[/else]
[/if]
[/list]

This list populates a combo box with a list of states. I would like to =
default the selection to the current value of mv_searchspec.

Tom



------=_NextPart_000_0035_01C07563.43591EA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4611.1300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Please forgive my ignorance, but I've =
been trying=20
to get the following snippet of code working for the past 3 days with no =

success.&nbsp; I'm simply try to set an &lt;option&gt; to selected in a=20
loop.&nbsp; Here is the snippet of code:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;[list]<BR>&nbsp;&nbsp;&nbsp; [if =
value=20
[value-extended name=3D"mv_searchspec" index=3D"0"] eq=20
[loop-code]]<BR>&nbsp;&nbsp;&nbsp; &nbsp; &lt;OPTION selected=20
VALUE=3D"[loop-code]"&gt;[loop-pos 1]<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
[else]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;OPTION=20
VALUE=3D"[loop-code]"&gt;[loop-pos 1]<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
[/else]<BR>&nbsp;&nbsp;&nbsp; [/if]<BR>&nbsp;[/list]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This list populates a combo box with a =
list of=20
states.&nbsp; I would like to default the selection to the current value =
of=20
mv_searchspec.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Tom</DIV>
<DIV><BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_0035_01C07563.43591EA0--
Using [if] [ In reply to ]
At 08:57 AM 1/3/01 -0500, you wrote:
>Please forgive my ignorance, but I've been trying to get the following
>snippet of code working for the past 3 days with no success. I'm simply
>try to set an <option> to selected in a loop. Here is the snippet of code:
>
> [list]
> [if value [value-extended name="mv_searchspec" index="0"] eq [loop-code]]
> <OPTION selected VALUE="[loop-code]">[loop-pos 1]
> [else]
> <OPTION VALUE="[loop-code]">[loop-pos 1]
> [/else]
> [/if]
> [/list]
>
>This list populates a combo box with a list of states. I would like to
>default the selection to the current value of mv_searchspec.
>
>Tom

Tom -

try it this way:

[seti spec][value-extended name=mv_searchspec index=0][/seti]
[list]
[if type=scratch term=spec op=eq compare="[loop-code]"]
...
[/if]
[/list]

..this assumes that [list] does something interative.

- Ed L.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
New Media E.M.S. Software Solutions for Business
463 Main St., Suite D edl@newmediaems.com
Placerville, CA 95667 http://www.newmediaems.com
(530) 622-9421 (530) 622-9426 Fax
(866) 519-4680 Toll-Free
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Using [if] [ In reply to ]
Ed -

Thanks, that fixed the problem! For future reference, could someone explain
why the original code doesn't work?

Tom

----- Original Message -----
From: "Ed LaFrance" <edl@newmediaems.com>
To: <interchange-users@lists.akopia.com>
Sent: Wednesday, January 03, 2001 11:36 AM
Subject: Re: [ic] Using [if]


> At 08:57 AM 1/3/01 -0500, you wrote:
> >Please forgive my ignorance, but I've been trying to get the following
> >snippet of code working for the past 3 days with no success. I'm simply
> >try to set an <option> to selected in a loop. Here is the snippet of
code:
> >
> > [list]
> > [if value [value-extended name="mv_searchspec" index="0"] eq
[loop-code]]
> > <OPTION selected VALUE="[loop-code]">[loop-pos 1]
> > [else]
> > <OPTION VALUE="[loop-code]">[loop-pos 1]
> > [/else]
> > [/if]
> > [/list]
> >
> >This list populates a combo box with a list of states. I would like to
> >default the selection to the current value of mv_searchspec.
> >
> >Tom
>
> Tom -
>
> try it this way:
>
> [seti spec][value-extended name=mv_searchspec index=0][/seti]
> [list]
> [if type=scratch term=spec op=eq compare="[loop-code]"]
> ...
> [/if]
> [/list]
>
> ..this assumes that [list] does something interative.
>
> - Ed L.
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> New Media E.M.S. Software Solutions for Business
> 463 Main St., Suite D edl@newmediaems.com
> Placerville, CA 95667 http://www.newmediaems.com
> (530) 622-9421 (530) 622-9426 Fax
> (866) 519-4680 Toll-Free
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users
Using [if] [ In reply to ]
At 01:51 PM 1/3/01 -0500, you wrote:
>Ed -
>
>Thanks, that fixed the problem! For future reference, could someone explain
>why the original code doesn't work?
>
>Tom
>
>----- Original Message -----
>From: "Ed LaFrance" <edl@newmediaems.com>
>To: <interchange-users@lists.akopia.com>
>Sent: Wednesday, January 03, 2001 11:36 AM
>Subject: Re: [ic] Using [if]
>
>
> > At 08:57 AM 1/3/01 -0500, you wrote:
> > >Please forgive my ignorance, but I've been trying to get the following
> > >snippet of code working for the past 3 days with no success. I'm simply
> > >try to set an <option> to selected in a loop. Here is the snippet of
>code:
> > >
> > > [list]
> > > [if value [value-extended name="mv_searchspec" index="0"] eq
> [loop-code]]


..syntax error. The correct form is [if value variable_name eq
some_value]. Your expression (above) is essentially [if value some_value
eq some_value] - not valid. The "value" type of if expects a variable name
for its term, not a variable value.

- Ed L.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
New Media E.M.S. Software Solutions for Business
463 Main St., Suite D edl@newmediaems.com
Placerville, CA 95667 http://www.newmediaems.com
(530) 622-9421 (530) 622-9426 Fax
(866) 519-4680 Toll-Free
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>