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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:37:43+00:00 2026-05-22T22:37:43+00:00

I got this script off 9lessons.info and it is supposed to auto suggest friends

  • 0

I got this script off 9lessons.info and it is supposed to auto suggest friends when you type an @ simbol. It works great! But it uses a contentbox enabled div as a text box, but as this is a HTML5 feature but i need a more compatible solution like a text area. But a textarea isnt working with the current jQuery, even with the same ID as the div. I am not good with jQuery so can anyone see why?

Source Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Facebook like Tag Friends</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>



 <script type="text/javascript">
$(document).ready(function()
{

var start=/@/ig;
var word=/@(\w+)/ig;

$("#contentbox").live("keyup",function() 
{
var content=$(this).text();
var go= content.match(start);
var name= content.match(word);
var dataString = 'searchword='+ name;

if(go.length>0)
{
$("#msgbox").slideDown('show');
$("#display").slideUp('show');
$("#msgbox").html("Type the name of someone or something...");
if(name.length>0)
{
$.ajax({
type: "POST",
url: "boxsearch.php",
data: dataString,
cache: false,
success: function(html)
{
$("#msgbox").hide();
$("#display").html(html).show();
}
});

}
}
return false();
});

$(".addname").live("click",function() 
{
var username=$(this).attr('title');
var old=$("#contentbox").html();
var content=old.replace(word,""); 
$("#contentbox").html(content);
var E="<a class='red' contenteditable='false' href='#' >"+username+"</a>";
$("#contentbox").append(E);
$("#display").hide();
$("#msgbox").hide();
$("#contentbox").focus();
});

});
</script>

</head>

<body>
<h3>Tutorial link <a href="http://9lessons.info">Click Here</a></h3>
<h2>Eg: 9lessons blog @sri</h2>
<div id="xxx"></div>
<div id="container">
<div id="contentbox" contenteditable="true"> 
</div>
<div id='display'>
</div>
<div id="msgbox">
</div>
</div>


</body>
</html>
  • 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-05-22T22:37:43+00:00Added an answer on May 22, 2026 at 10:37 pm

    Try:

    var html = $('#contentbox').html();
    var textarea = $('<textarea />').attr('id', 'contentbox').html(html);
    $('#contentbox').replaceWith(textarea);
    

    See: http://jsfiddle.net/yFKRX/1/

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

Sidebar

Related Questions

I got this javascript code from off the internet. It's a script that changes
I got this script called rapidshare link checker v2 php by Bigfish At the
I've got this script on my website : $(document).ready(function() { function filterPath(string) { return
I really need some quick tips here. I've got this VBScript script which sends
I've got this simple Perl script: #! /usr/bin/perl -w use strict; use Data::Dumper; my
I got this jQuery pre-loading script running on a index.html page loading about 10Mb
I just got help in how to compile this script a few mintues ago
I've got this piece of code in my jquery validation script: resetForm: function() {
I've got this bit of JQUERY: <script> function initNav() { $('.nav tr table td
How do I execute an output piped from a bash script? I got this

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.