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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:58:22+00:00 2026-06-18T05:58:22+00:00

What I am trying to accomplish: Clicking a button adds a word to filter

  • 0

What I am trying to accomplish:

Clicking a button adds a word to filter the jQuery Mobile ListView.

HTML:

<ul data-role="listview" data-theme="a" data-divider-theme="c">
                <li data-role="list-divider" data-inset="true">
                    <div data-role="controlgroup"  data-type="horizontal" data-mini="true" id="filterButton">
                        <a href="#" data-role="button" data-inline="true">Iedereen</a>
                        <a href="#" data-role="button" data-inline="true">LinkedIn</a>
                        <a href="#" data-role="button" data-inline="true">Facebook</a>
                        <a data-role="button" style="width: 4px;"></a>
                        <a href="#" data-role="button" data-inline="true" class="filterAdd">Design</a>
                        <a href="#" data-role="button" data-inline="true">Development</a>
                    </div>
                </li>
            </ul>
            <ul data-role="listview" data-filter="true" data-theme="d" data-divider-theme="d" data-filter-placeholder="Search Connections...">
                <li data-theme="b"><a href="index.html">
                    <img src="http://a0.twimg.com/profile_images/1353509401/DSC_3465_bigger.jpg" class="ui-li-thumb zapp-corner zapp-margin-5 zapp-inner-shadow" />
                    <h3>Stephen Weber</h3>
                    <p><strong>You've been invited to a meeting at Filament Group in Boston, MA</strong></p>
                    <p>Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.</p>
                    <p class="ui-li-aside"><strong>LinkedIn</strong></p>
                </a></li>

JavaScript

$(document).ready(function () {
                    $("#filterButton").delegate("a", "click", function () {
                        $("div.ui-input-search").find("input").val($(this).text());
                        $("div.ui-input-search").find("input").keyup();
                    });
}); 

At this moment it replaces the whole value inside the input field instead of adding it to the existing value.

http://jsfiddle.net/J4HZp/6/

  • 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-18T05:58:24+00:00Added an answer on June 18, 2026 at 5:58 am
    $("#filterButton").delegate("a", "click", function () {
         var txt = $(this).text();
         $("div.ui-input-search").find("input").val(function(i, currentValue) {
            return currentValue + txt;
         }).trigger('keyup');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to accomplish delete in page which is filled with data by
What I'm trying to accomplish is: Clicking on anchor tag that has href like
I'm trying to accomplish function that adds values to a session variable, which is
I'm trying to accomplish a multiple word searching in a quotes database using Ruby,
I have some hierarchical data I am manipulating with JQuery, and I am trying
What I'm trying to accomplish is to get aggregated data for all unique combinations
Im trying to accomplish something which may seem a bit convoluted but would be
I'm trying to accomplish a simple thing. I have a 2 levels menu with
I'm trying to accomplish something very, very similar to the below picture with CSS3
I'm trying to accomplish this but I've got no clue about getting a GWT

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.