[ic] undeletable items - SOLVED

Aaron Hazelton interchange-users@icdevgroup.org
Tue Jun 3 12:39:00 2003


On Fri, 30 May 2003 19:13:51 -0400, Aaron Hazelton <aaronmail@hazenet.net> 
wrote:

> On Fri, 30 May 2003 22:43:54 +0100, Jamie Neil <jamie@versado.net> wrote:
>
>
>> [snip]
>>> > I know I've got stuck on "if" syntax more times than I can remember.
>>> >
>>> > Jamie
>>>
>>> I know, these 'ifs' give me a headache! Unfortunately, this does not
>>> work either.  Actually my code does produce the expected results as
>>> to the form elements, it just seems to be the removal of an item when 
>>> all
>>> that is left in the cart are these on fly items coming from
>>> the quote ...
>>
>> Sorry, didn't read your post carefully enough :)
>>
>> Have you checked the html to make sure the inputs are being named 
>> correctly?
>> What you are describing sounds like a problem I had where all the 
>> quantity
>> related inputs were called "quantity0" instead of being unique to each 
>> item.
>>
>> Jamie
>
> I had actually forgotten about that... but I just checked and they
> are correct.
>

thanks again Jamie, you got me on the right track, and i got it!

>>
>>>
>>> >
>>> >> no_delete]1[/tmp][/if]
>>> >>
>>> >> (the remove area)
>>> >> [if scratch no_delete]
>>> >> <small><small>Quote<BR>Item</small></small>
>>> >> [else]
>>> >> <INPUT TYPE=checkbox NAME="[quantity-name]"
>>> >> onClick="this.form.action='[process-target]', this.form.submit()"
>>> >> VALUE=0>
>>> >> [/else]
>>> >> [/if]

what actually solved the problem, is to add a hidden input value for
the quantity of the quote items.  Then they are not modifyable, but
every item evidently needs to have the form input value for a deletion
to work.  so, changing the above to this worked:

[if scratch no_delete]
	<small><small>Quote<BR>Item</small></small>
	<input type=hidden name="[quantity-name]" value="[item-quantity]">
[else]
	<INPUT TYPE=checkbox NAME="[quantity-name]"
	onClick="this.form.action='[process-target]', this.form.submit()"
	VALUE=0>
[/else]
[/if]

>>> >>
>>> >> (the quantity area)
>>> >> [if scratch no_delete]
>>> >> <B>[item-quantity]</B>
>>> >> [else]
>>> >> <INPUT TYPE=text NAME="[quantity-name]" VALUE="[item-quantity]" 
>>> SIZE=3>
>>> >> [/else]
>>> >> [/if]
>>> >>
>>> >> [tmp no_delete][/tmp]
>>> >> [/item-list]
>>> >>
>>> >> >
>>> >> Here's my problem: Even though this is working correctly and
>>> >> displaying the
>>> >> 'remove' checkbox and the 'qty' input for items
>>> >> that are not on a quote, when you click the remove check or '0'
>>> >> the input,
>>> >> the page refreshes, and the item will not go
>>> >> away.
>>> >>
>>> >> More info: if you have items in the cart BEFORE adding these
>>> >> quote items in (via OnFly) then all deletable items can be removed.
>>> >> However, if you have ONLY quote items in and then
>>> >> add other items, all of those subsequent items cannot be removed.
>>> >> weird..
>>> >>
>>> >> Any ideas on what is going wrong?  there is no error in the
>>> >> logs ...
>>> >>

thanks again

-- 
Aaron Hazelton
Hazenet.net