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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:44:14+00:00 2026-06-06T01:44:14+00:00

In my .NET project I’m using a Button in HTML page that brings a

  • 0

In my .NET project I’m using a Button in HTML page that brings a hidden <div>. That <div> contains a form to insert a company.

HTML:

<div class="top-div-where-is-my-ADD-button">
    <h2>
        Search:
        <input type="text" id="search" />
        <div id="divADD" onclick="AddCompany()">
            <span>Add Company</span></div>
    </h2>
</div>

    <div id="hide" style="visibility: hidden; height: 0px; padding-bottom: 10px;">
    <table id="CompanyDetails" class="company" style="width: 100%; text-align: center;">
.........
</div>

JavaScript:

function AddCompany() {
    HideCompany();
    $(hide).css({ visibility: "visible", height: "auto" });
    var a = document.getElementById("divbuttonSaveCompany");
    a.onclick = InsertCompany; 
}

function InsertCompany() {
    var a = document.getElementById("Name").value;
    var b = document.getElementById("Address").value;
    var c = document.getElementById("Country").value;
    var d = document.getElementById("Phone").value;
    var e = document.getElementById("Fax").value;
    var f = document.getElementById("Email").value;
    var gg = document.getElementById("Contact");
    var g = gg.options[gg.selectedIndex].value;
    $.ajax({
        url: '@Url.Action("AddCompany", "Company")',
        data: { nameCompany: a, address: b, country: c, phone: d, fax: e, email: f , contact: g},
        dataType: "html",
        type: "POST",
        error: function () {
            alert("error");
        },
        success: function (data) {
            alert("Company was successfully added! ");
            $("#all").html(data);
        }
    });
}
function HideCompany() {
    $(hide).css({ visibility: "hidden", height: "0" });
    $("#Name").val("");
    $("#Address").val("");
    $("#Country").val("");
    $("#Phone").val("");
    $("#Fax").val("");
    $("#Email").val("");
}

So basically in IE when I push the button AddCompany the hidden <div> appears, but in FF doesn’t.

Does anyone know what I need to do to fix this?

  • 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-06T01:44:17+00:00Added an answer on June 6, 2026 at 1:44 am

    The problem is this:

    $(hide)
    

    That works in IE because IE makes a global variable from every element with an “id”. Firefox won’t do that.

    Change all references to $(hide) to $('#hide').

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

Sidebar

Related Questions

I have an ASP.Net project using AJAX that I am putting on a server
In an ASP.NET project I have the following HTML: <asp:PlaceHolder ID=plcTitle runat=server></asp:PlaceHolder> <div id=divStrapline
I have a .net project (MySolution.Common) that uses the app.config. I am using the
I have an ASP.NET project that contains many classes. I am thinking about creating
I am doing asp.net project using C#.I want to display the contents that are
I am writing asp.net project in C#. I have a button in a page
In a recent VB.NET project I adopted the naming conventions I'm used to using
I have a asp.net project, and in my design page I have some asp:Label
In my asp .net project, my main page receives URL as a parameter I
i have a asp.net project and its using jqgrid as the javascript grid. How

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.