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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:52:06+00:00 2026-05-27T19:52:06+00:00

I’ve wrestled with this half the day or more. I cannot figure out what

  • 0

I’ve wrestled with this half the day or more. I cannot figure out what is wrong. I stripped out other javascript functions, php code, etc; and I still get a page reload rather than an asynch call with nothing returned. Firebug does not show an XHR call either.

Jquery is loaded properly and works fine for other functions. Just any ajax or jSON call fails to work asynchronously.

I even changed the keypress function to a simple button click handler and the same result…nothing.

If I load the “findmatch.php” page directly it generates the proper result.

Another program in this same directory uses lots of ajax and jSON calls effortlessly and flawlessly. Same doctype, same version of jquery, same structure of the ajax call….I’m baffled in a major way. I keep looking for really stupid errors because that is what these things tend to be…but no luck.

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

    $('#searchtext').live('keypress',function(e)

    {       if (e.which == 13)          {
                mysearch=$("#searchtext").val();            if(mysearch=="")            {
                        alert("Trying typing something in the box, ok?");           }           else            {
                    $.ajax({
                    url: 'findmatch.php',                          
                    data: 'x='+mysearch,            
                    dataType: 'html',
                    success: function(res)          
                    {
                         alert(res);    

                        if(res.length>0)
                        {
                            buildit="<table><tr><td>id</td>td><b>Machine Name</b></td></tr>";   

                            buildit=buildit+res+"</table>";

                            $("#searchresults").html(buildit);

                            $("$searchtext").focus();
                        }
                        else
                        {
                            $("#searchresults").html("No Results Found");
                            $("#searchtext").focus();
                        }
                    }
                    });             }
                            }     });


    });

    </script>

</head>

<body>


<div class="searchy">
<h3>Search for an existing record?</h3>

<form>
Enter a Machine Name to search for, such as "bl-psy-srv" or "psy-srv" or something similar. A partial name will return appropriate matches. Hit Enter to submit.
<br />
<input type=text id="searchtext" size=30>
</form>

</div>

<div class="searchy" id="searchresults">
</div>
  • 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-27T19:52:06+00:00Added an answer on May 27, 2026 at 7:52 pm

    Is #searchtext in a form? I think Enter will trigger a submit action on the form, and you’re not preventing it. Try inserting an e.preventDefault(), see how it goes.

    Unrelated, you probably want to URL-encode mysearch, or better yet just use an object – jQuery is smart enough to convert it into a proper form: { x: mysearch }

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the

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.