Jump to content

Search the Community

Showing results for tags 'radio button'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 2 results

  1. I'm developing a form which is essentially a simple set of radio buttons. Conceptually, it is like this: Please select a theme from the list: o Black o Blue o Red [submit] [Reset] I'm actually showing a slideshow of images showing the appearance of each of the themes in a slideshow that only shows one image at a time. I want my users to click on the image that represents the theme they want and, ideally, not have to click on the Submit button at all. Then I will save the name of the theme they chose in a cookie (if cookies are enabled). Many years ago, I dabbled in things like CGI and I have a vague recollection, possibly faulty, that it's not difficult to make a form that has only one set of radio buttons treat the selection of one of the radio buttons as a Submit. I don't remember how to do it though. Can anyone advise me on whether it is indeed possible and, if it is, how I make the selection of the radio button cause the form to be submitted?
  2. Hi people, I'm new to PHP, and I'm having some real difficulties with trying to re-populate a radio button selection on a form. Basically, I'm working on a WordPress plugin which uses custom fields to create a Bet custom post type. I need to have my form submit the user input, then re-populate it so that if the user wants to edit and update the Bet data, they don't have to fill in the whole form details again, they can just edit what they need to, and update (re-submit) the form. I've managed to get all of the form elements re-populating, apart from a radio button. I've been trawling round the internet for most of yesterday evening and this morning, trying different things, but nothing I've found works for me. I'd really appreciate some help if anyone knows how to do this. Here's my code so far (non working) <?php $win_status = 'checked = "unchecked"'; $ew_status = 'checked = "unchecked"'; if (isset($bet_details_bet_type)) { $selected_radio = $bet_details_bet_type; if ($selected_radio == 'WIN') { $win_satus = 'checked = "checked"'; } elseif ($selected_radio == 'EW') { $ew_status = 'checked = "checked"'; } } echo '<label for="bet_details_bet_type">Bet Type: </label>'; echo '<input type="radio" name="bet_details_bet_type" id="bet_details_bet_type" value="WIN" '. esc_attr( $win_status) .' /> Win '; echo '<input type="radio" name="bet_details_bet_type" id="bet_details_bet_type" value="EW" '. esc_attr( $ew_status) .' /> Each Way </br>'; $bet_details_bet_type is the VARIABLE that gets sent to / pulled from $_POST I have another function which is handling that, which has the following in it. $bet_details_bet_type = $_POST['bet_details_bet_type']; update_post_meta( $post_id, 'bet_details_bet_type', $bet_details_bet_type ); I know that the sending and retrieving is working okay, as the Value is stored and retrieved when I update (submit) the bet, but I just can't seem to get the radio button to be re-checked to the value that was submitted. Again, if any can help with this I would be very grateful. Thanks, Dweezer
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.