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

  • Home
  • SEARCH
  • 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 203511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:23:07+00:00 2026-05-11T17:23:07+00:00

I am trying to design a file hosting website template, the problem is i

  • 0

I am trying to design a file hosting website template, the problem is i have redesigned the radio buttons to div elements to have custom image instead of default circles with javascript,

This is image 1 when default page loads

<script type="text/javascript">
<!--
//script to change background-color of the selected
//button and put the appropriate value in an input object
function btnClick(btnNum){
for (i=1;i<=4;i++){
tempBtnVal=document.getElementById('btnVal')
tempBtn=document.getElementById('btn'+i)
tempBtn.style.backgroundPosition=(i==btnNum?'0 -163px':'0 -30px')
tempBtn.style.color=(i==btnNum?'#333':'#6a7072')
}
tempBtnVal.value=btnNum
}
//-->
</script>

my html

<div id="btn1" name="btn1" class="buttonDiv" value='1' onclick="btnClick('1')" style="background: url(images/inSprite.png) no-repeat scroll 0 -163px; color:#333;"><div id="btnTxt">local</div></div>

<div id="btn2" name="btn2" class="buttonDiv" value='2' onclick="btnClick('2')"><div class="btnTxt">remote</div></div>

if i click on any other tab it works fine and that tab gets selected

Image 2 when clicked on URL Upload

but the script store the cookie of last selected tab, so next time a person visits the site automatically that tab is shown, so as i have manually hard coded the css in the div it breaks the design, like in image below i selected “URL Upload” and than reloaded the page

Image 3 when exited the browser and revisited the site

in selector it is showing Form Upload but instead URL Upload tab is open.

Please help me solve the problem so that if URL Upload is open it show the URL Upload selected in tab above.

I cant use any framework due to limitations, i can only use javascript but not framework. Please help me solving as i have very less knowledge of javascript.

Thank You very much.

Regards,

Shishant Todi

  • 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-11T17:23:07+00:00Added an answer on May 11, 2026 at 5:23 pm

    You need to preserve the state of the radio buttons after the browser closes. Cookies are the only way I can think of doing this, and you can manipulate cookies using javascript. (googling “javascript cookies” yields a lot of good tutorials for this.)

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

Sidebar

Ask A Question

Stats

  • Questions 192k
  • Answers 192k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer We use FogBugz's default fields, which are: Project (roughly mapped… May 12, 2026 at 6:23 pm
  • Editorial Team
    Editorial Team added an answer Have your app monitor the environment variable, and exit when… May 12, 2026 at 6:22 pm
  • Editorial Team
    Editorial Team added an answer Inheriting from object makes a class a "new-style class". There… May 12, 2026 at 6:22 pm

Related Questions

I am trying to adapt a perl script that is used to generate a
I am trying to design an application in 3 layers : 1) Data access
I am trying to style the product view on a Drupal site, but am
I am trying to design an edifact parser, I was planning on having one

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.