[ic] selected tag use on item-quantity fix?

Korey G. interchange-users@icdevgroup.org
Fri Jul 19 13:00:01 2002


May it be unrefined as much as possible but it works like a charm
Thanks Ed,

PS.
  Before I tried to work with a pull down bar,
I thought it would be kinda neat if we had a
text box with an alert that says "no no no too many items"
and change it to the most allowed,

So I tried to re-implement the foundState function as
check_quan()

<SCRIPT>
function check_quan(form){
var ch = this.form;
      if(ch > "5") {
       alert("You have more than 5 items");
       return this.form = 5;
   }
}
</SCRIPT>

and trigger as this:

<input type="text" name="[quantity-item]" value="[item-quantity]" 
onChange="check_quan(this.form)">

But I can't seem to have to work
Do you by chance have any idea about this too?
Just wondering

-Korey


At 08:54 7/19/02 -0700, you wrote:
>At 11:33 AM 7/19/2002 -0700, you wrote:
>>Im having difficulty implementing a memory for pulldown
>>My client would like to limit the purchase per item to 5
>>sounds good to me Ill just  drop a pull down in there, right?
>>
>>NO,.
>>
>>This is what happens
>>
>>         Pre-IC-Processing::
>>
>>         [item-quantity]
>>         <select name="[quantity-name]">
>>                 <option [selected [item-quantity] 0]>0
>>                 <option [selected [item-quantity] 1]>1
>>                 <option [selected [item-quantity] 2]>2
>>                 <option [selected [item-quantity] 3]>3
>>                 <option [selected [item-quantity] 4]>4
>>                 <option [selected [item-quantity] 5]>5
>>         </select>
>
>Even if your syntax was right (which it is not), it would not work until 
>the first time the basket was recalculated *after* each item was added. It 
>is better to do something like this with perl:
>
><select name="[quantity-name]">
>[calc]
>         my $qty = q{[item-quantity]};
>         my $out;
>         foreach (qw(1 2 3 4 5)) {
>                 $out .= qq{<option value=$_};
>                 $out .= q{ SELECTED} if $qty == $_;
>                 $out .= qq{> $_\n};
>         }
>         return $out;
>[/calc]
></select>
>
>...an unrefined example but it should work.
>
>- Ed L.
>
>
>
>
>
>>         Post Ic Processing::
>>         1
>>         <select name="quantity0">
>>                 <option >0
>>                 <option >1
>>                 <option >2
>>                 <option >3
>>                 <option >4
>>                 <option >5
>>         </select>
>>
>>
>>I used this example to make my primary script and cant understand why
>>it (1) doesnt display select on "<option >1" and (2) what happend to the 
>>" value=1 "
>>should I even be expecting interchange to do (2) for me or what?
>>http://www.icdevgroup.org/cgi-bin/ic/docfly.html?mv_arg=ictags04%2e64
>>
>>
>>Help a kid out,
>>
>>  Please
>>
>>:)
>>
>>_______________________________________________
>>interchange-users mailing list
>>interchange-users@icdevgroup.org
>>http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
>===============================================================
>Increase profits from your Interchange store...
>http://www.newmediaems.com/cgi-bin/nm/software_fus.html
>===============================================================
>New Media E.M.S.               Software Solutions for Business
>463 Main St., Suite D          eCommerce | Consulting | Hosting
>Placerville, CA  95667         edl@newmediaems.com
>(530) 622-9421                 http://www.newmediaems.com
>(866) 519-4680 Toll-Free       (530) 622-9426 Fax
>===============================================================
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@icdevgroup.org
>http://www.icdevgroup.org/mailman/listinfo/interchange-users