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

  • Home
  • SEARCH
  • 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 8356753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:16:41+00:00 2026-06-09T10:16:41+00:00

Is it possible to send the server only the last 3 words in the

  • 0

Is it possible to send the server only the last 3 words in the textarea and to autofill the best result, letting the user keep typing in (similar to Google auto complete)?

I want the behavior to be:

  1. N[ew]
  2. New[er]
  3. New(SPACE)[er]
  4. New [York]
  5. New c[ar]
  6. New cat [food]
  7. New cat (TAB) [food]
  8. New cat food [makes]
  9. …
  10. New cat food is good for your cat’s [health]

(clarification: the [square brackets] indicates the suggestion that is automatically being typed in, the bold text indicates the part being sent to the server, (TAB) and (SPACE) indicates tab and space key presses)

I already a have function on the server for predicting the next word (using Markov chains) and I have integrated jQuery UI autocomplete, but currently it just sends all the text to the server and creates a list with all the suggestions to choose from, once you choose it changes the whole text.

So it eventually comes to these issues:

  1. How to send only the last part?
  2. How to append + select the suggested word?
  3. How to select on Tab key?
  • 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-09T10:16:42+00:00Added an answer on June 9, 2026 at 10:16 am

    Okay – here is the solution (and here is the result):

    1 + 2: Instead of managing a single input box, I use two identical size textarea’s, the first (#text-area) is enables and with transparent background and the other (#suggestions) is disabled and with gray text color. I use the source callback to do all the work:

    $('#text-area').autocomplete({ ...
    
    source: function( request, response ) {
            if (request.term.length < 3) {
              return false;
            }
            $.getJSON( $SCRIPT_ROOT + '/_get_word', {
              term: request.term
            }, function(data) {
                $('#suggestions').val(data.result) //suggestion is the disabled textarea
              }
              );
            return false;
          }, 
     ...
        });
    });
    

    3: the tab key selection is done with triggering the autocomplete search event:

    $('#text-area').live( "keydown",'textarea', function( event ) {
            if ( event.keyCode === $.ui.keyCode.TAB) {
              event.preventDefault();
              $('#text-area').val($('#suggestions').val());
              $("#text-area").autocomplete('search', $('#text-area').val());
          }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to send an intent only to one service when this one
using the checkTL() function, i need to send to the server (for example) only
Is it possible to send data from app engine server to another,external server with
Is it possible to send mail asycronously using PHP while giving live user feedback
In Mongo, it's possible to have a database residing in only one server (but
Possible Duplicate: PHP - send file to user I have written a script that
It is possible to send POST data from JQUery to server, located in another
I want to use SQL Server to send email and found two possible way
Is it possible a Web client to send multiple HTTP queries to a server
Is it possible to send data to another C++ program, without being able 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.