Jump to content

garyed

Members
  • Posts

    176
  • Joined

  • Last visited

Posts posted by garyed

  1. Is it possible to keep the selected drop down box choice on the screen after submitting it on a form?

    Here's a sample code, if I choose medium the correct number will be shown but the selection will immediately return

    to high. I don't have this problem in javascript but I'd like to code this in php but i have a lot of drop down boxes.

    <html>
    <head></head>
    <body>
    <form method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
    <select name="rpms"> 
    <option name="high" value="1200"> high</option>
    <option name=medium value="1000">medium</option>
    <option name="low" value="825"> low </option>
    <br>
    <input type="submit" value="Submit"> 
    <?php
    $speed = $_GET[rpms];
    ?>
    </form>
    <div id="new_speed"> <?php echo ($speed); ?> </div>  
    </body></html>
    

×
×
  • 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.