Hi All,
I have the following piece of code in an html form:
<input type="radio" name="radio_search" value="All_of_Intranet">All of + Intranet <input type="radio" name="radio_search" value="group_info">This Group
This form gets submited to a perl script that checks what the user clicked on then does somthing based on the value. Here is the way that i'm checking for the value:
my $radio_search=param("radio_search"); if ($radio_search eq "All_of_Lehman") { &search_all(); } elsif ($radio_search eq "test") { &search_group(); } else { print "$radio_search - test<br>"; print "<br><font size=+2><b>Error:</b></font><br>"; print "<br> You need to specified if you want to search the entire + intranet or the current group"; print "<br><br><a href=javascript:history.go(-1)>Back</a>"; exit(); }
Unfortunately, this is not working. I think that i first need to check which of the two elements was checked then grab the value of the checked element. This i can do in javascript, but it would be easier and better if i can do it in Perl. Thanks for your help in advance.
-Kiko

Edit Masem 2001-08-08 - Fixed typo in title


In reply to How do i check a radio button in Perl? by Kiko

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.