[ic] Modifying posted form with mv_click

Jamie Neil interchange-users@icdevgroup.org
Mon Apr 28 07:38:01 2003


Sorry - got it now (amazing what 2 hours sleep can do for you)

Just for the record, I did it like this:

                                [button
                                        text="Remove Item [item-increment]"
                                        src="remove.gif"
                                        hidetext=1
                                        form=basket
                                ]
                                mv_todo=refresh
                                mv_nextpage=ord/basket
                                [quantity-name]=0
                                [/button]

The key is to use [item-increment] in the button text so each button has a
unique name.

Jamie

> -----Original Message-----
> From: interchange-users-admin@icdevgroup.org
> [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Jamie Neil
> Sent: 28 April 2003 12:20
> To: interchange-users@icdevgroup.org
> Subject: [ic] Modifying posted form with mv_click
>
>
> Hi,
>
> Does anyone know if there is a way of modifying a form field when it is
> posted using an mv_click block?
>
> The reason I ask is that I am trying to create a "Remove" button for my
> basket using the [button] tag.
>
> I know this can be done using pure javascript to update the
> [quantity-name]
> field onclick, but this has a couple of drawbacks. First it is
> obviously not
> good for noscript browsers, but another issue I am having is that
> it causes
> a problem if the customer uses the back button. If they click
> through to the
> checkout from the basket, and then click back in the browser, if they then
> click on the remove button for an item it will remove the item but the
> refresh will display the checkout page rather than the basket (you can
> confirm this behavoir in the IC 4.9 Demo). I think it is because
> mv_nextpage
> is being set by the checkout page and then not being overridden by going
> back in the browser.
>
> Using a button tag seems to fix this because it can set the mv_nextpage
> explicitly. But I can't add an onclick action to the button
> (using the extra
> option) to clear the quantity field without breaking the button. I also
> don't want to rely on JavaScript - it seems cleaner to me to do the item
> removal in the mv_click.
>
> Suggestions?
>
> Jamie Neil
> Versado I.T. Services Ltd.
> Tel: +44 (0)1702 525348
> Mobile: +44 (0)7970 132709
> Mailto:jamie@versado.net
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>