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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:38:25+00:00 2026-05-26T08:38:25+00:00

i have a form where i am storing the time spent by users on

  • 0

i have a form where i am storing the time spent by users on site so for every user there is one id and my form is

<form id="mycash" name="form6" method="post" action="">
<input name="Time_Spent1"  value="'.$row['Time_Spent'].'"  id="Time_Spent1"        type="text" size="7" readonly="readonly" /><input type="button" name="task" id="task" value="submit">

i am using this javascript to submit the form using ajax .but it is not working.

<script language="javascript">$(document).ready(function(){
$("form#mycash").submit(function() {
var Time_Spent1     = $(\'#Time_Spent1\').attr(\'value\');
var task     = $(\'#task\').attr(\'value\');
    $.ajax({
        type: "POST",
        url: "page.tpl.php",
        data: "Time_Spent1="+ Time_Spent1 + "&\'{$client[\'id\']}\'="+ \'{$client[\'id\']}\'+ "&task="+ task,
        success: function(){
            $(\'form#mycash\').hide(function(){$(\'div.success\').fadeIn();});

        }
    });
return false;
});

});

i want to submit this form every 20 seconds automativcally . any suggestion where i am doing mistake

  • 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-26T08:38:25+00:00Added an answer on May 26, 2026 at 8:38 am

    I don’t see any automation. Try this:

    (function submitForm(){
        setTimeout(function(){
            $("form#mycash").submit();
            submitForm();
        },20000);
    }());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent quite some time going through similar questions here and have not
I want to convert a table storing in Name-Value pair data to relational form
I have a form that a user fills out, which submits information to my
I have a signup form of which most fields are pre-filled using user's Facebook
Thank you for your time, I have spent a good part of my day
I made a Servlet for an online form and every time I try to
I have a backend where people may take some time filling out the form.
I have a form that sometimes gets linked to with some query string parameters.
I have an array of integers in string form: var arr = new string[]
I want to store data in string form to MySQL. I have created 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.