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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:06:37+00:00 2026-06-07T18:06:37+00:00

I had a longer post describing what I am trying to do, but I

  • 0

I had a longer post describing what I am trying to do, but I don’t think that is necessary so I’m making this simple. I’m working on getting Zurb Foundation to work with Datatables. It’s been pretty easy except for the drop down menu. I’ve had a bit of a tough time getting this working as a js novice. Here is the general syntax of a Foundation drop down.

<label for="customDropdown">Dropdown Label</label>
<select style="display:none;" id="customDropdown">
  <option select="selected">This is a dropdown</option>
  <option>This is another option</option>
  <option>Look, a third option</option>
</select>
<div class="custom dropdown">
  <a href="#" class="current">This is a dropdown</a>
  <a href="#" class="selector"></a>
  <ul>
    <li class="selected">This is a dropdown</li>
    <li>This is another option</li>
    <li>Look, a third option</li>
  </ul>
</div>

Where I’ve run into problems is my event listener to update the table length fires on a click on the UL, so the table length is updated with the previously selected length. Because the Foundation JS is the one updating the UL LI, every attempt to detect the change doesn’t work because my code is firing before Foundation applies the class to the LI.

So to update the table it seems clear I have to detect the change of either the option value

$('div#example_length form select').val()

or in the LI

$('div.custom ul li.selected').text()

I tried chaining the .change() function onto the above to detect the change in value but it’s giving me an error. I’m pretty lost here. I’ve spent quite a bit of time trying to work this out.

Edit: Just to be clear, what I’m trying to do is get the correct value for the drop down when it’s selected. I get a value now but it’s the one previously selected not the one just selected. Because of the way that Foundation works I’m having a hard time doing that with my green belt jQuery skills.

Thanks.

  • 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-07T18:06:39+00:00Added an answer on June 7, 2026 at 6:06 pm

    I feel a bit stupid for not figuring this out quicker; such is the learning process.

    $('div.custom ul', nLength).on('click', 'li', function(event) {
    foo = $(this).text();
    console.log(foo);
    });
    

    What I discovered in this is that ‘bind’ for some reason was only detecting the first event, whereas ‘on’ detected every event action.

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

Sidebar

Related Questions

I was getting ready to post this as a question, but after fiddling around
Probably a simple answer that's mock or stub related but I'm newish and trying
I actually previously had a much longer question but I figured this would be
the problem is probably simple, the post is longer than I wished, but I've
Had a page that was working fine. Only change I made was to add
Had a good search here but can't see anything that gets my mind in
Had this working; at one stage. The problem is the following text is now
I had a debate about macros and their readability. I think that in some
I had a post similar to this awhile ago based on a error I
I had my form processes working perfectly but after renaming the form action to

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.