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 been doing some tests (to replace old code) with the __invoke magic
I have a Delphi application that has many dependencies, and it would be difficult
Through the last years I have different types of software to organize my photo
I have a situation where I have an interface that defines how a certain
I am using Ankhsvn 2.0.6347.433 with Visual Studio 2005 and it's reporting that Ankhsvn's
I've been thinking about batch reads and writes in a RESTful environment, and I
I am trying to take a rather large CSV file and insert it into
I remember when I used to develop website in Japan - where there are
I'm having some images from which the user should choose one. Now I don't
I'm trying to create routes which follow the structure of a tree navigation system,

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.