[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
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