[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
RE: how to keep checkbox state?
****** message to minivend-users from "Russ" <russ@khouse.org> ******
I think i can show you how to solve your problem, but not with a checkbox.
Implement two radio buttons, one for "Not a Gift Order" and the other for
"Is a Gift Order"
<input type="radio" [if !value gift]checked[/if] name="gift" value="0">NOT a
Gift
<input type="radio" [if value gift]checked[/if] name="gift" value="1">Is A
GIFT
The way I actually implemented mine is this
<input type="radio" [if !value b_name_first]checked[/if]
name="mv_successpage" value="ord/checkout2">Separate Billing Address is
<b>NOT</b> needed.<br>
<input type="radio" [if value b_name_first]checked[/if]
name="mv_successpage" value="ord/checkout1">Click Here if a different
Billing Address <b>IS</b> needed.
The implication is that a gift order must have a separate billing address,
and checkout1 is the page the user enters the separate billing address.
The logic of the radio box checks is this: If you have filled out the
billing address, it will indicate a gift order. if not, not.
I hope this is at least minorly helpful.
-----Original Message-----
From: owner-minivend-users@minivend.com
[mailto:owner-minivend-users@minivend.com]On Behalf Of Ryan
Sent: Friday, March 19, 1999 8:49 AM
To: minivend-users@minivend.com
Subject: how to keep checkbox state?
****** message to minivend-users from Ryan <rps@willconsult.com>
******
Hello. I am having problems keeping a checkbox state.
If a user checks a checkbox indicating that they are
ordering this as a gift, how can they unselect this?
By checking the box, box_gift gets set to 1. Then
they reload the form, and the checkbox shows up checked,
like it should, then they uncheck it, and reload. Since
unchecked checkboxes do not get transmitted, it stays
set at 1. How can I get around this? Below is some of
the code I've tried in the order profile.
Thanks a lot for any help.
Ryan
[perl cgi values]
# unchecked checkboxes do not get submitted, so special processing is
required
unless ( $Safe{'cgi'}->{box_gift} )
{ $Safe{'values'}->{box_gift} = 0; }
unless ( $Safe{'cgi'}->{box_shipto} )
{ $Safe{'values'}->{box_shipto} = 0; }
unless ( $Safe{'cgi'}->{box_correction} )
{ $Safe{'values'}->{box_correction} = 0;}
unless ( $Safe{'cgi'}->{box_othercat} )
{ $Safe{'values'}->{box_othercat} = 0; }
[/perl]
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list