473,471 Members | 2,040 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Clearing radio_group

I would like to be able to deselect a radio_group when the user selects
to clear the form.

#!/usr/local/bin/perl

use CGI qw(:standard);
$query = new CGI;

my $policy = "blank";

if( param( 'action' )) {
if( param( 'action' ) eq "Clear" ) {
$policy = "blank";
}
}

print header(), start_html(), start_form();

print radio_group( -NAME=>'level',
-VALUES=>[ 'Personal', 'Complete' ],
-LINEBREAK=>'true',
-DEFAULT=>$policy );

print br, $policy, br;

print br, submit( -NAME=>'action',
-VALUE=>'Clear' ), " ";

print end_form(), end_html();
Jul 19 '05 #1
1 3698

Crossposting to a long-since deceased newsgroup isn't recommended.
Followups set.

On Tue, 14 Dec 2004, Nerfherder wrote:
I would like to be able to deselect a radio_group
That's a logical impossibility. A radio group is defined by the fact
that exactly one of the buttons is always selected. Any client
implementation which doesn't do that could be described as buggy.

That has nothing to do with Perl nor with CGI.pm: it's a fact of
the HTML specification.

If you want a radio button option which means "user hasn't made a
selection", then you need a third radio button for it, and select that
as the default.[1]
#!/usr/local/bin/perl

use CGI qw(:standard);
$query = new CGI;


I'd recommend using strict and warnings. In a CGI context, the -T
(taint checks) option is strongly recommended too, as a safety belt.
[1] this might help, though - as I say - it has nothing to do with
Perl as such: http://ppewww.ph.gla.ac.uk/~flavell/www/testradio.html

It may well be that your chosen browser can do what you reckon you
wanted; but the HTML specification still says what it says. I'd say
design within its constraints.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Niels | last post by:
Hi group, I have some problems with clearing floated divs. My usual method works fine in Konqueror, but not in Firefox. Here's an example: <html><body> <div id='left' style='float:left;...
0
by: Gary | last post by:
I have a problem with the datagrid not clearing when the datasource changes, a few fields remain on the screen and even when new data would fill those grid squares the old data remains. I wind...
4
by: Roubles | last post by:
Hi All, Quick question; what is the difference between initializing and clearing a structure like this: mystruct_t a = {0}; and initializing and clearing it like this:
1
by: raghavendra | last post by:
Hi, i am facing problem clearing screen in console application. As, in C++ we have clrscr(); Is? their any similar type of function is avaliable.. Raghavendra...
9
by: Werner Hempel | last post by:
Hello, I'm trying to do a simple three column layout, with two divs (#left and #right) floating left and right, and the #content-div with margins in between, and all three in a wrapper-div. The...
65
by: Steven Watanabe | last post by:
I know that the standard idioms for clearing a list are: (1) mylist = (2) del mylist I guess I'm not in the "slicing frame of mind", as someone put it, but can someone explain what the...
0
by: negmat | last post by:
Hello everyone, I have the following question: I am aware that the objects currently in the cache can be viewed by issuing the following command: SELECT * FROM master.dbo.Syscacheobjects ...
65
by: Leslie Kis-Adam | last post by:
Hi everyone! Does anyone know, if it is possible to clear the screen in ANSI C? If it is,then how? Any help would be appreciated. Laszlo Kis-Adam <dfighter_AT-NOSPAM_freemail.hu
1
by: Vayse | last post by:
I have a databound form, frmClients. One of the field is a combo box, comDepartment, which lets a user select a department for the Client. But I can't figure out how to clear the box. That is,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.