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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:07:58+00:00 2026-06-07T14:07:58+00:00

The js function will not work in my SITE but when I try it

  • 0

The js function will not work in my SITE but when I try it in JSFIDDLE it shows to work fine. I have included DOM ready but it doesn’t trigger anything. I checked with firefox and input value is not posted at all. How can I get the JS function to fire up properly after user stops typing?

JS

<script>
$(document).ready(function() {
 var timer = null; 
 var dataString;   
 function submitForm(){
   alert("success");
   $.ajax({ type: "POST",
            url: "index.php",
            data: dataString,
            success: function(result){
              alert("success");
               /*$('#special').append('<p>' +  $('#resultval', result).html() + '</p>');*/

            }

   });
   return false;
 }
 $('#submit').on('keyup', function() {
    clearTimeout(timer);
    timer = setTimeout(submitForm, 2000);
    var name = $("#name").val();
    dataString = 'name='+ name;
 });
 }); 
</script>

HTML

 <input id="name" name="name" type="text" class="field text medium" value="<? $url ?>" maxlength="255" tabindex="1"     />
  • 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-07T14:08:01+00:00Added an answer on June 7, 2026 at 2:08 pm

    The problem is that in the HTML above you have id="name" but are binding to "#submit".

    You have id="submit" in your jsfiddle example, which is why it works.

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

Sidebar

Related Questions

I use the following Javascript function.It will not work.It will give the Undefined Error
Most systems will have a user-defined function (UDF) available. Some will not. i want
I have issues with Firefox and keydown function. It will not trigger the function
Sometimes you have a function that will work for flat arguments. For example: send(player,message)
Example: /** * This function will determine whether or not one string starts with
I am attempting to collapse a div on request, but my setTimeout function will
I have a function that will parse some data coming in. My problem is
I am trying to stop some events but stopPropagation does not work with live
I have just added the fb:comments FBML tag to a site. Working 100%, but
We're looking into Zendesk for our support site but it's not very customizable. I'm

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.