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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:41:48+00:00 2026-05-21T23:41:48+00:00

This is really strange, and I’ve been beating my head against it for hours

  • 0

This is really strange, and I’ve been beating my head against it for hours now and can’t figure it out.

I’m using jQuery to hide some elements on a form (tagged with the class .read-only) and show other elements (tagged with the class .edit-version).

Basically, the user clicks an edit link, and within the parent of that link, the read-only items are hidden and the edit items (inputs) are displayed. This works fine.

The problem happens in the response from the server, which is passing back the opposite case. It finds the div that’s hosting the form, and it hides the edit versions and displays the read only. Except it doesn’t. Here’s the code:

host = $('#employee-card-49');
$('.edit-version', host).hide();
$('.read-only', host).show();

I’ve verified that it’s got the correct div (#employee-card-49) is found, and is the right item, and is the only item with that id on the page.

I’ve verified that $('.edit-version', host).length is correct. It returns 3, indicating it’s finding the three elements.

I’ve verified that each returned item from $('.edit-version', host) is correct. I can get the properties of them.

No javascript errors come up, but the hide() and show() calls just don’t modify the display property at all. I’ve even tried calling css('display', 'none') without avail.

If I change the call to $(‘.edit-version’).hide() call, it works, but that would affect other divs on the page that I don’t want to affect.

Any help would be appreciated.

  • 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-21T23:41:49+00:00Added an answer on May 21, 2026 at 11:41 pm

    This isn’t a great solution, but it did work. Getting rid of host scope altogether and instead using the scope in the selector itself solved the problem.

    $('#employee-card-49 .edit-version').hide();
    $('#employee-card-49 .read-only').show();
    

    Weird.

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

Sidebar

Related Questions

This is really strange and I can't seem to figure out why it won't
This is really strange but this code is working fine unless the value entered
This really, really urks me, so I hope that someone can give me a
This is really strange to me and it's becoming into a real problem. I'm
Okey this is really strange. I have this script which basically downloads bunch of
This is really strange, I'm not sure what could be causing the code to
this is really strange, i have an array in delphi and fill it with
This case is really strange, i've spent 2 whole days to get Twitter Oauth
This is a really strange problem I'm seeing in my app. I have an
This is really strange. Absolute path doesn't work for both ifstream and ostream. It

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.