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

  • Home
  • SEARCH
  • 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 6372683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:16:09+00:00 2026-05-25T01:16:09+00:00

am having problem, my app doesn’t seem to check the radio button based from

  • 0

am having problem, my app doesn’t seem to check the radio button based from the saved data. actually i have two radio buttons, it has a value of 1 or 2 , the saving of the value does work, but when the user visited the app again using his/her account,none of the radio buttons are checked

here’s the code for the pulling of data of the radio button from the db table

//User.php
public function getGalleryMenuStyle($id = ''){
    $gallerymenustyle = "SELECT gallery_menu_style FROM users WHERE user_id = ".$id;
    $this->dbSelectQuery = $gallerymenustyle;
    $checkedgallerymenustyle = $this->userDBSelect();
       if($checkedgallerymenustyle){
           return $checkedgallerymenustyle;
       } else {
           return false;
       }
}

here’s the code for the front-end

$userCats = new User();
$user_id = $_SESSION['userData']['user_id'];
$checkedgallerymenustyle = $userCats->getGalleryMenuStyle($user_id);

    <div align="center" class="radio_group">
        <input type="radio" id="gallerymenustyle1" class="element radio" name="gallerymenustyle[]" value="1" <?php if($checkedgallerymenustyle == 1){ echo "selected"; }?> /> Gallery Link - In the navigation of my website, display one "gallery" link<br />
        <input type="radio" id="gallerymenustyle2" class="element radio" name="gallerymenustyle[]" value="2" <?php if($checkedgallerymenustyle == 2){ echo "selected"; }?> /> Category Links - In the navigation of my website, display a separate link to each category.
    </div>

how to fix this ? is there anything wrong with my code ?

  • 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-25T01:16:09+00:00Added an answer on May 25, 2026 at 1:16 am

    Radio buttons use “checked” not “selected”

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

Sidebar

Related Questions

I have created a simple JSF image browsing app, and I'm having a problem
I'm having a problem running a VS 2005 app on some machines and not
I'm having a problem with a administrative app I'm working on. I'm build an
I'm having an annoying problem with my iPhone app. Whenever I set the optimization
I've some pocket pc app and i'm having a serious problem with it described
Is having to recycle an App-Pool in ASP.NET indicative of a larger problem in
I'm having a problem in my Ruby on Rails app with a model where
I'm having a troubling problem testing some code for and Android app. My app
I'm having problems deploying a simple WebServices app (like Hello World simple) to OC4J.
I am having some performance problems with my Delphi 2006 app. Can you Suggest

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.