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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:04:32+00:00 2026-06-05T04:04:32+00:00

I have a select form that sends the value when you change the select.

  • 0

I have a select form that sends the value when you change the select. Unfortunately, everytime it sends it goes back to the option “10”. How can I have it (for example) so you can click on the 20 option and send form and stay on 20?

Here is the code:

<form method='get' name='FormVote'>
     <select name="vote" onChange="document.forms['FormVote'].submit()">
             <option selected="selected" value='10'>10</option>
             <option value='20'>20</option>
             <option value='30'>30</option>
             <option value='40'>40</option>
     </select>
</form>

Any help will be greatly appreciated! Thanks!

  • 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-05T04:04:33+00:00Added an answer on June 5, 2026 at 4:04 am

    it’s staying on 10 because of the
    selected=”selected”
    attribute in the option for 10

    To have it remember where the user put it you’ll need to fetch its value from the database and then do something like this in PHP:

    foreach ($optionsArray as $option) {
        echo '<option ';
        if ($theOptionValue == $savedUserOptionValue)
            echo 'selected="selected"';
        echo 'value="', $theOptionValue, '>', $theOptionValue, '</option>';
    }
    

    Or you could use AJAX to send the form to the server in which case the page won’t refresh and the option box will stay where it is.

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

Sidebar

Related Questions

i have a form that has a multiple select drop down. a user can
I have a form that looks like this. <form action=index.php method=post> <select name=dropdownOption> <option
The select form component in grails can have the form: <g:select name=user.age from=${0..59} value=${age}
I have this select input in my form that I want to access via
I have a select form element with 5 options. If option 2 is selected
I have a form in which the user can either select from a pre-existing
I'm banging my head for some hours now. I have a select option that
I have a combobox on a web form. The user can select a single
I have a form, depending on the selected value of my <select> box I
I have a form with elements like: <div class=row1> <select name=someSelectField multiple=multiple class=selectList> <option

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.