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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:44:22+00:00 2026-06-15T13:44:22+00:00

What I want is, when i use the tab key on the last list

  • 0

What I want is, when i use the tab key on the last list select menu I want to get an alert. With the jquery i’ve got I will get an alert but on every select menu instead of only the last.

HTML markup

<div id="invoiceLinesForm" style="">
<ul id="sortable" class="ui-sortable">
    <li id="headerLine">
        <div class="qty">Aantal</div>
        <div class="description">Omschrijving</div>
        <div class="price">Bedrag EUR</div>
        <div class="total">Totaal</div>
        <div class="vat">BTW</div>
        <div class="actions"></div>
        <div class="clear"></div>
    </li>

    <li id="firstLine">
        <div class="qty"><input type="text" name="invoice_line[0][qty]" value="1" class="qty_input"></div>
        <div class="description"><textarea name="invoice_line[0][description]"></textarea></div>
        <div class="price"><input type="text" name="invoice_line[0][price]" value="0.00" style="text-align:right;"></div>
        <div class="total">0,00</div>
        <div class="vat">
            <select name="invoice_line[0][vat]">
                <option value="0.21">21%</option>
                <option value="0.06">6%</option>
                <option value="0.00">0%</option>
            </select>
        </div>
        <input type="hidden" name="invoice_line[0][total]" class="line_total" value="0">
        <input type="hidden" name="invoice_line[0][vat_amount]" class="line_vat_amount" value="0">
        <input type="radio" class="line_selector" style="display:none;">

        <div class="actions"><span class="delLine">Verwijder </span><span>Slepen</span></div>
        <div class="clear"></div>
    </li>

    <li class="extraLine">
        <div class="qty"><input type="text" name="invoice_line[1][qty]" value="1" class="qty_input"></div>
        <div class="description"><textarea name="invoice_line[1][description]"></textarea></div>
        <div class="price"><input type="text" name="invoice_line[1][price]" value="0.00" style="text-align:right;"></div>
        <div class="total">0,00</div>
        <div class="vat">
            <select name="invoice_line[1][vat]">
                <option value="0.21">21%</option>
                <option value="0.06">6%</option>
                <option value="0.00">0%</option>
            </select>
        </div>
        <input type="hidden" name="invoice_line[1][total]" class="line_total" value="0">
        <input type="hidden" name="invoice_line[1][vat_amount]" class="line_vat_amount" value="0">
        <input type="radio" class="line_selector" style="display:none;">

        <div class="actions"><span class="delLine">Verwijder </span><span>Slepen</span></div>
        <div class="clear"></div>
    </li>
    <li class="extraLine">
        <div class="qty"><input type="text" name="invoice_line[2][qty]" value="1" class="qty_input"></div>
        <div class="description"><textarea name="invoice_line[2][description]"></textarea></div>
        <div class="price"><input type="text" name="invoice_line[2][price]" value="0.00" style="text-align:right;"></div>
        <div class="total">0,00</div>
        <div class="vat">
            <select name="invoice_line[2][vat]">
                <option value="0.21">21%</option>
                <option value="0.06">6%</option>
                <option value="0.00">0%</option>
            </select>
        </div>
        <input type="hidden" name="invoice_line[2][total]" class="line_total" value="0">
        <input type="hidden" name="invoice_line[2][vat_amount]" class="line_vat_amount" value="0">
        <input type="radio" class="line_selector" style="display:none;">

        <div class="actions"><span class="delLine">Verwijder </span><span>Slepen</span></div>
        <div class="clear"></div>
    </li>
</ul>

jquery

$('.vat select').live('keyup', function(e) 
{ 
    if (e.keyCode == 9) 
    {               
        $(this).blur(function(e)
        {
            if($(this).parent().parent().is('li:last'))
            {
                alert('last item');
            }

            e.preventDefault();
            e.stopImmediatePropagation();

        });                 
    } 

});
  • 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-15T13:44:23+00:00Added an answer on June 15, 2026 at 1:44 pm
        if($(this).parents("li").is(':last-child'))
        {
            alert('last item');
        }
    

    Demo: http://jsfiddle.net/UtHKR/3/

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

Sidebar

Related Questions

I want use JQuery mobile for the front-end of my mobile application, but I
I want to register when the key Tab has been pressed, but can't figure
I want to use Ctrl + Tab in an emacs application. But the Ubuntu
Newbie- I want to do 2 things with these checkboxes: Use TAB key to
reference How can I disable the use of the Tab key to select the
i am using tab bar control in my app and want to use the
I want use BYTE_ORDER macro in my Xcode project but i can't because i
I want use jQuery in my project. I know the javascript_include_tag calls the jQuery
I want to use a tab control to switch between sets of data displayed
I'm trying to simulate an actual tab key press in JavaScript. I don't want

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.