Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 657895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:52:27+00:00 2026-05-13T22:52:27+00:00

Is it possible to validate a radio group (so something is checked off, or

  • 0

Is it possible to validate a radio group (so something is checked off, or chosen) using server-side validation with Perl? If so, how?

I already have it for JavaScript, but I want this form to be able to be submitted even without JavaScript enabled. Thus I will need the validation on the server-side.

There is no fixed name for the radio group, it can change, however there must be a name, so that @names = $cgi->param() will give all the names.

I’m thinking along something that will give me the type, like the type in JavaScript, to determine if it’s a radio button in a group.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:52:27+00:00Added an answer on May 13, 2026 at 10:52 pm

    Your CGI script receives form fields as name-value pairs without any information as to what type of visual form element generated the values.

    Your CGI script must know the names of the input variables whose values it is going to validate. Having the names supplied to the script based on untrusted user input is risky IMHO—that includes using another field whose value is the name of the radio group.

    Say, you have a variable called contact_me which can take on values "yes" and "no". There is absolutely no reason for your CGI script to care if the value was provided using

    <select name="contact_me">
    <option value="yes" selected="1">Please do!</option>
    <option value="no">Oh no!!!</option>
    </select>
    

    or using

    <input type="radio" name="contact_me" value="yes" checked="1">
    <input type="radio" name="contact_me" value="no">
    

    or if the user typed her answer into the text field

    <input name="contact_me">
    

    The only thing your CGI script needs to concern itself with is if the value of contact_me is "yes" or "no".

    It looks like you do not have a firm grasp of CGI. Please see The World Wide Web Security FAQ: CGI (Server) Scripts as a starting point.

    Please stop all of your CGI development until you understand the ramifications. I retract this remark in light of your comments clarifying the use of a config file to define parameter names (which, in principle, is orders of magnitude safer).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know its probably possible, but is it practical and doable to try and
I know its probably possible, but is it practical and doable to try and
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
My question is about memory use and objects in actionscript 2. If I have
I am trying to load a html page through UIWebview.I need to disable all
I'm trying to write test harness for part of my Android mapping application. I
I am writing a query to fetch results for all the values in a
I'm trying to build a Chrome browser extension, that should enhance the way the
This is beyond both making sense and my control. That being said here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.