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 9148923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:24:10+00:00 2026-06-17T11:24:10+00:00

I have all ready succeded with validating number, email and message and so on.

  • 0

I have all ready succeded with validating number, email and message and so on.

My problem now is how do I validate radio/check btn.

Here is how i validate etc Message:

// Validates msg

if (!isset($_POST[$field]) || empty($_POST['message'])) {
    $error_msg .= " ";  
    $fieldStatusMessage = 'style="border:1px solid #F00"';
}
else {
    $fieldStatusEmail = '';
}

Would be helpful if someone could explain or show me. I thinks its really close to what im doing now ?

  • 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-06-17T11:24:11+00:00Added an answer on June 17, 2026 at 11:24 am

    You can do something like below

    Example 1

    PHP

    <?php
      if($_Post[]) {
            if($_POST['list'] == -1)
                    echo 'Please select one on the List';
             else {
                    ............
             }
    }
    ?>
    

    HTML

    <form method="post">
     <select name="list">
             <option value="-1">Select One</option>
             <option value="1">One</option>
             <option value="2">Two</option>
    </select>
    <input type="submit" name="submit">
    </form>
    

    Example 2

    HTML

    <form name="frm1" action="action.php" method="post">
        Active ? 
        <input type="radio" name="myrdo" value="Y" /> Yes
        <input type="radio" name="myrdo" value="N" /> No
        <br />
        Education:
        <input type="checkbox" name="mychk" value="G" /> Graduate
        <br />
        Country:
        <select name="country">
            <option value="" selected="selected">Select</option>
            <option value="1">USA</option>
            <option value="2">UK</option>
            <option value="3">Canada</option>
        </select>
        <br />
        <input type="submit" name="btnSubmit" value="Submit Form" />
    </form>
    

    PHP

    if($_SERVER['REQUEST_METHOD'] == 'POST'){ 
        $error_msg = array(); 
        if(!isset($_POST['myrdo'])){ 
            $error_msg[] = "No radio buttons were checked."; 
        } 
        if(!isset($_POST['mychk'])){ 
            $error_msg[] = "Graguate was checked"; 
        } 
        if(!isset($_POST['country'])){ 
            $error_msg[] = "No country as selected."; 
        } 
    
        if(isset($error_msg) && count($error_msg) == 0){ 
            // do some form processing 
        } 
        else{ 
            // redirect to the form again. 
        } 
    }  
    

    Read more

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

Sidebar

Related Questions

Is it possible to have one jQuery ready block executed after all others have
I have a simple JavaScript file that has three jQuery $document.ready functions. All three
I have read all threads about this without finding any answer to my problem.
I have a problem. I need to trace all read/write operations to the registry
My problem is a little bit complex. I have the following code: $(document).ready(function() {
I have read all the documentation I found on how to integrate Unity3D projects
I have read all the articles regarding img and srcs, buttons with autopostpack. Pretty
I have read all the docs I can get my hands on and google'd
I have already read all the previous similar posts but I couldn't find a
I just want what my title says.I have already read all the previous similar

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.