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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:11:12+00:00 2026-06-13T16:11:12+00:00

I met some trouble with my code, In fact I would like to replace

  • 0

I met some trouble with my code,

In fact I would like to replace words abreviation by their expressions, but it does not work.

I have done the following code:

<script>
    $('#suivi').keyup(function (e) {
        var code = e.which ? e.which : e.keyCode;
        var input = this.value;
        console.log(input);
        <?php
            $rqt = "SELECT * FROM `glossaire` WHERE `id_company` ='".$societe['id']."'";
            $result = mysql_query($rqt);
            while ($data = mysql_fetch_assoc($result)) {
        ?>
                if (input == "<?php echo ($data['libelle']) ; ?>") {
                    this.value = "<?php echo ($data['texte']) ; ?>"
                };
        <?php
            }
        ?>      
   });
</script>

jquery 1.8 is set up on my page.

This script works fine on the following jsfiddle:

http://jsfiddle.net/3z3sP/1/

But not in my page. However it is the same.

I have no mistakes in the console of javascript.

Any kind of help will be much appreciated.

Kind regards.

SP.

  • 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-13T16:11:13+00:00Added an answer on June 13, 2026 at 4:11 pm

    The jsfiddle works fine for me. I think your code is being executed before the #suivi is found. Try wrapping the script in $(function(){}):

    <script>
    
        $(function()
        {
    
            $('#suivi').keyup(function(e){
            var code = e.which ? e.which : e.keyCode;
            var input = this.value;
            console.log(input);
          <?php $rqt="SELECT * FROM `glossaire` WHERE `id_company` ='".$societe['id']."'";
        $result=mysql_query($rqt);
        while($data=mysql_fetch_assoc($result))
        {?>
            if (input == "<?php echo ($data['libelle']) ; ?>") {
               this.value = "<?php echo ($data['texte']) ; ?>"
    
            };
         <?php } ?>      
        });
    
        });
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some MET data I want to validate which would look something like
I met some compilation error but do not know what the problem is. The
I have an implementation that just like gmail application, but have met some problem
I met some trouble with a javascript. In fact I have in my database
I met some troubles while using PHPExcel, In fact I have read all the
I met some trouble in php json decode number. $json = '[{num:123456789011121314},{num:1516171819202122232425}]'; $number =
I met some basic problem in jquery, but I can't figure it out. Here
I have some design requirements that are not supported by Entity Framework, but are
I want to make a PHP JSON data foreach, but I met some problem.
I met some trouble while using input type dates, also I decided for reasons

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.