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
There's something really strange happening, and I'm hoping someone can figure this out for
This really shouldn't be hard, I just can't figure out how to do it.
This is a really strange issue. When using WebClient.DownloadFile in Debug configuration, it appears
This is really strange behavior. When I try make a search using findItemsAdvanced to
This is a really strange issue, and I can't for the life of me
This is a really strange error I have been getting sometimes with SOME libraries
Getting something really strange that I just can't work out. I have 3 methods
This seems really strange to me: f = File.open(Dir.pwd+'/tmp','r') f.readlines do |l| puts #{f.lineno}:#{l}
this is really strange, yesterday I asked the question Yesterdays question how to implement

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.