GithubHelp home page GithubHelp logo

Comments (6)

boulderbri avatar boulderbri commented on July 20, 2024

I've created a very basic example demonstrating this problem without ASP.NET. The html is in:

https://gist.github.com/4225453

I apologize if this is not the best way to send source.

With this example, I'm seeing two issues. It appears there are two different states maintained for the checkbox values. For example, when contracted, I can uncheck 1-5 and check 6-10 and, when expanded, I can uncheck 8-14 and check 1-7. If I flip back and forth between more/less, the state of the values also flips back and forth.

The second issue I'm seeing is what I described above. In the contracted state, if I uncheck 1-5 and hit submit, the form data sent shows 1-5 as checked.

It appears to be always submitting the values of the checkboxes in the expanded state. I was able to verify this with a few tests.

Am I using this wrong or should I not be using the expander with form elements? I appreciate any help! Thanks for your time in building and supporting these great tools!

Regards,
Brian

from jquery-expander.

kswedberg avatar kswedberg commented on July 20, 2024

Thanks for the report. I'm not sure, just by reading your description, why this would be happening, so I really appreciate the gist. It's kind of confusing since, once the plugin modifies the DOM when it's called, it doesn't do anything special with the contents of the details other than show and hide them. I'll look into it and get back to you as soon as I can.

from jquery-expander.

boulderbri avatar boulderbri commented on July 20, 2024

Hi Karl,

I have a home-grown expander on another similar page also just using
hide/show. I thought that behavior was really strange, especially
maintaining the state between the two. Please let me know if I can help
explain, test or do anything else.

Kind regards,
Brian

On Thu, Dec 6, 2012 at 11:07 AM, Karl Swedberg [email protected]:

Thanks for the report. I'm not sure, just by reading your description, why
this would be happening, so I really appreciate the gist. It's kind of
confusing since, once the plugin modifies the DOM when it's called, it
doesn't do anything special with the contents of the details other than
show and hide them. I'll look into it and get back to you as soon as I can.


Reply to this email directly or view it on GitHubhttps://github.com//issues/55#issuecomment-11096682.

from jquery-expander.

kswedberg avatar kswedberg commented on July 20, 2024

Thanks, Brian. I think I figured out what the problem is. When the plugin detects block-level elements that need to be split up, it takes the "safe route" and retains the entire contents for the "detail" as well as slicing up just enough for the "summary" and copying it into the summary div. This helps preserve the block formatting and avoids all sorts of brokenness. In your case, unfortunately, it means that you have two sets of the first 10 checkboxes. One thing you could do is bind a change handler to the checkboxes that changes the checked state of any other checkbox with the same name. Not terribly elegant, but it's working here: http://jsfiddle.net/kswedberg/YEwVu/

from jquery-expander.

boulderbri avatar boulderbri commented on July 20, 2024

Wow. Good catch, Karl. That's interesting.

I appreciate your suggested fix. I'll put that in and try it out. Since
I'm in ASP.NET and using autopostbacks with update panels, the autopostback
already binds a change handler to the checkbox. I'll give it a try and
test!

Thanks again!
Brian

On Thu, Dec 6, 2012 at 1:50 PM, Karl Swedberg [email protected]:

Thanks, Brian. I think I figured out what the problem is. When the plugin
detects block-level elements that need to be split up, it takes the "safe
route" and retains the entire contents for the "detail" as well as slicing
up just enough for the "summary" and copying it into the summary div. This
helps preserve the block formatting and avoids all sorts of brokenness. In
your case, unfortunately, it means that you have two sets of the first 10
checkboxes. One thing you could do is bind a change handler to the
checkboxes that changes the checked state of any other checkbox with the
same name. Not terribly elegant, but it's working here:
http://jsfiddle.net/kswedberg/YEwVu/


Reply to this email directly or view it on GitHubhttps://github.com//issues/55#issuecomment-11103169.

from jquery-expander.

kswedberg avatar kswedberg commented on July 20, 2024

Closing due to inactivity.

from jquery-expander.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.