tarunkhanna has asked for the wisdom of the Perl Monks concerning the following question:
In the above program, I want background color of textarea to be changed according to the radiobutton selected.use CGI; $co = new CGI; print $co->header; print $co->start_html(); print $co->start_form; print $co->radio_group( -name => 'color', -id => 'color', -values => ['red','yellow','green'], -default => 'red', -onClick => "return select_color()" ).$co->p; #How to handle $color below so that whatever color i select with radio +button that color is displayed in textarea?? print $co->textarea( -style=>"background-color:$color; color:blue", ); print $co->end_form; print $co->end_html; print <<COLOR_SCRIPT; <script language="JavaScript"> function select_color() { var color = document.getElementById('color').value; return color; } </script> COLOR_SCRIPT
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: COLOR of textarea
by aaron_baugher (Curate) on Nov 14, 2011 at 12:37 UTC | |
Re: COLOR of textarea
by marto (Cardinal) on Nov 14, 2011 at 10:37 UTC | |
Re: COLOR of textarea
by Anonymous Monk on Nov 14, 2011 at 09:42 UTC | |
| |
Re: COLOR of textarea
by locked_user sundialsvc4 (Abbot) on Nov 14, 2011 at 14:50 UTC | |
Re: COLOR of textarea
by liverpole (Monsignor) on Nov 14, 2011 at 18:10 UTC |