[ic] change state to a select in admin/entry

Paul Jordan paul at gishnetwork.com
Mon May 3 19:02:41 EDT 2004


Jeannie Stevenson [webteam at wes-state.com] wrote:
> good day listies
>
> I have a change that is needed to admin/entry. I need to have the
> state be a dropdown select like include/checkout/shipping_address
> instead of the input that it is now. I've tried to copy the code from
>    the ...shipping_address file <TD>     [loop search=" fi=state.txt
>    sf=country
>    se=[default country US]
>    rf=state,name,country
>    un=yes
>    tf=sorder,name
>    ml=100
>     "
>     option=state]
>     [on-match]<SELECT onChange="check_avail(this.form)"
> NAME=state><option value="">--[L]select state[/L]--
>     [/on-match]
>     [list]
>     [loop-change 1][condition][loop-param country][/condition]
>     <OPTGROUP LABEL="[data table=country col=name key='[loop-param
>     country]']"> [/loop-change 1]
>     <OPTION VALUE="[loop-code]">[loop-pos 1]
>     [/list]
>     [on-match]</SELECT>[/on-match]
>     [no-match]<INPUT NAME=state VALUE="[value state]"
>   SIZE=20>[/no-match]     [/loop] </td>
>
> but when I view it, it comes up with 56 select boxes with no states
> to select in them. Also all the inputs have the default="code"
> entered into the boxes
>
> Can someone please point me into the direction to help me with this
> problem as I've been working on a solution for 3 days now :-(
>
> Thankyou
>
> ScottA

I don't think you posted enough code. the above looks fine, except for that
using [default country US] may trip you up. You should try to grab the country
based on whatever that page uses to display the user info, probably a [data ..]
tag, I don't know off the top of my head. You'll also probably throw a js error
unless you include the 'check_avail' function on that page as well, or remove
the call to it.

Oh, you know what, you probably placed this inside another [loop] or [query]
and your "inside" [on-match] and [list] stuff are not being honored, so your
getting 56 of your [loops] generated.

Look at "nesting loops" :

http://www.icdevgroup.org/i/dev/docfly.html?mv_arg=ictags04%2e44


Paul



More information about the interchange-users mailing list