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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:54:48+00:00 2026-06-15T11:54:48+00:00

In my page for file upload field i set the attibute style in javascript

  • 0

In my page for file upload field i set the attibute style in javascript as below

choicefile.setAttribute("style", "width: 86px;
                                  position: absolute;
                                  margin-left: 83px;  //This pixels shows the upload field in a correct place
                                  margin-top: 90px;  // This pixels shows the upload field in a correct place
                                  z-index: 1;
                                  opacity: 0;");

But in Firefox it shows the file upload in a wrong place. In firefox if we change the two attributes as

choicefile.setAttribute("style", "width: 86px;
                                  position: absolute;
                                  margin-left: 35px;  //In Firefox it is the correct pixels
                                  margin-top: 150px;  //In Firefox it is the correct pixels
                                  z-index: 1;
                                  opacity: 0;");       

How can i solve this problem. Anybody can help for this problem. Thanks in advance

My URL is

http://mytest.php?id=2&mview=69

After click the addnewentry the file uploader displayed in correct place but in firefox it is displayed in wrong place.

<form name="choiceadd" action="" method="post" enctype="multipart/form-data" onsubmit="return validationaddchoice();">
<span id="addnewcontain">
</span>
<input type="hidden" name="choicecount" value="0" />
<div class="four" style='margin-top:40px;'>
<input type="button" value="Add New Entry" onclick="addnewchoice(document.forms['choiceadd']['choicecount'].value)" >
</div>
<div class="five">
<input type="submit" name="choiceaddsubmit" class="choiceaddsubmit" />
</div>
</form>

The above is the form in main page. When click this button the function addchoice is called and it includes the choicefile attribute style mentioned above

The function is

function addnewchoice(val)
{choicefile.setAttribute("style", "width: 86px; position: absolute; margin-left: 83px; margin-top: 90px; z-index: 1; opacity: 0;");
}
  • 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-15T11:54:49+00:00Added an answer on June 15, 2026 at 11:54 am

    instead of setting style like this, you can do it like the one below for fully cross browser compatibility.Assign each style property like the one below

    instead of setting style

    function addnewchoice(val)
    {   
       choicefile.setAttribute("style", "width: 86px; position: absolute; margin-left: 83px; margin-top: 90px; z-index: 1; opacity: 0;");
    }
    

    you can set it like this for cross browser compatibility

    function addnewchoice(val)
        choicefile.style.width="86px";
        choicefile.style.position="absolute";
        ... so on..
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im my web page having file upload option..it has to check two conditions. 1)whether
I am implementing a jquery file upload page. While a user is adding files,
I'm working on a web page with a file upload form that uploads a
in web page ,image control and file upload are there.if click file upload and
On my current page I use old file upload with input element. However, now
I have a page where the user can dynamically add file upload boxes. Adding
I have a file upload control <input id=File1 type=file /> in my page... How
In the web page, I have file upload widget. I need to show this
I need to upload .dat file from jsp page. I am using struts. I
I need to upload a file from the client to an asp.net page. The

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.