Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default value

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I have this radio group on an input/edit form. The input works fine but when I use it as an edit form, I cannot get the inital value to be checked. If I select an option and submit the form, with errors, to force it to display again, the selected item is then checked.

What have I missed?
Code:
my @stylez=('Not Specified','Detached House','Semi Detached House','Terraced House','Ground Floor Flat','First Floor Flat');

$STYLELIST= $query->radio_group(-name=>'STYLE',
	-values=> \@stylez,
	-default=>"Semi Detached House",
	-linebreak=>'true');

Keith
 
The following experiment reveals the answer.
The name 'STYLE' is not acceptable, presumably because it is a HTML tag. Change the name and all is well.

Code:
print $query->radio_group(-name=>'test',
-values=>['YES','NO'],
-default=>$ans,
-linebreak=>'true');

print $query->radio_group(-name=>'STYLE',
-values=>['YES','NO'],
-default=>$ans,
-linebreak=>'true');

Keith
 
It would appear that this is not the answer.
The problem is the name of the radio group being in upper case, using lower case and all is well, how very odd!

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top