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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:05:33+00:00 2026-05-17T15:05:33+00:00

I have a similar problem like old problem of mine. my code: function reset_admin()

  • 0

I have a similar problem like old problem of mine.

my code:

function reset_admin()
{
    a = document.getElementById('event').value;
    t = document.getElementById('category').value;
    document.getElementById('admin').reset();
    document.getElementById('event').value = a;
    document.getElementById('category').value = t;
}
<form id="admin" action="iframe_admin.php" onsubmit="" method="post" target="iframe_admin">
.....
<input type="button" class="filter_button" id="Clear" name="Clear" value="Clear" 
onclick="reset_admin();document.getElementById('admin').submit(); />

the function is in external js file.
the propose is that after pressing on clear, the event and the category will stay the same before the clear.

In ff it’s works. In IE the event and the category are empty and than the page get stacked.
I tried to do:

function reset_admin()
{
    a = document.getElementById('event').options[getElementById('event').selectedIndex].value;
    t = document.getElementById('category').options[getElementById('category').selectedIndex].value;
    document.getElementById('admin').reset();
    document.getElementById('event').value = a;
    document.getElementById('category').value = t;
}

but this is not working as well.

thank you!

  • 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-17T15:05:33+00:00Added an answer on May 17, 2026 at 3:05 pm

    Store and restore the selectedIndex instead since you don’t care about the actual value, like this:

    function reset_admin()
    {
        var a = document.getElementById('event').selectedIndex,
            t = document.getElementById('category').selectedIndex;
        document.getElementById('admin').reset();
        document.getElementById('event').selectedIndex = a;
        document.getElementById('category').selectedIndex = t;
    }
    

    I also added var to the indexes your fetching, just to about the global variables there, but that’s not the important change, setting selectedIndex instead is 🙂

    You can give it a try here.

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

Sidebar

Related Questions

I have a similar problem to this post . I need to display up
We have similar code to the following in one of our projects. Can anyone
I have code similar to this filtering entries in an Array of Objects: var
I have code similar to the following in many places: var dbParams = db.ReadParams(memberID,
There is a design problem like this. Suppose you have a set of class
I have read through the solutions to similar problems, but they all seem to
I have a few tables that have similar fields but not exactly the same.
I have created a bunch of movie clips which all have similar names and
For testing purposes I need to create sets of text files that have similar
I have several similar methods, say eg. CalculatePoint(...) and CalculateListOfPoints(...). Occasionally, they may not

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.