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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:55:45+00:00 2026-06-03T06:55:45+00:00

I have written a code, which is auto-logout when user doesn’t perform any activity.

  • 0

I have written a code, which is auto-logout when user doesn’t perform any activity.
But one thing, I am not able to figure out.
I want that when I select the options from the drop-down, it will be passed to AJAX,
Can you please modify that so that I can send the data from options to AJAX.

<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<style type="text/css">
#idletimeout { background:#CC5100; border:3px solid #FF6500; color:#fff; font-family:arial, sans-serif; text-align:center; font-size:12px; padding:10px; position:relative; top:0px; left:0; right:0; z-index:100000; display:none; }
#idletimeout a { color:#fff; font-weight:bold }
#idletimeout span { font-weight:bold }
</style>

</head>
<body>

<div id="idletimeout">
You will be logged off in <span><!-- countdown place holder --></span>&nbsp;seconds due to inactivity.
<a id="idletimeout-resume" href="#">Click here to continue using this web page</a> Please select reason for being idle.
<select id='idleReason' size="1">
<option value="nothing" selected="selected">Select a site</option>
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
<option value="Option 4">Option 4</option>
</select>

</div>

Content Lorem Impsum

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>
<script src="jquery.idletimer.js" type="text/javascript"></script>
<script src="jquery.idletimeout.js" type="text/javascript"></script>
<script type="text/javascript">
$.idleTimeout('#idletimeout', '#idletimeout a', {
        idleAfter: 3,
        pollingInterval: 2,
        keepAliveURL: 'keepalive.php',
        serverResponseEquals: 'OK',
        onTimeout: function(){
                $(this).slideUp();
                window.location = "timeout.htm";
        },
        onIdle: function(){
                $(this).slideDown(); // show the warning bar
        },
        onCountdown: function( counter ){
                $(this).find("span").html( counter ); // update the counter
        },
        onResume: function(){
                $(this).slideUp(); // hide the warning bar
        }
});
//
</script>


</body>
</html>

I would be grateful to you.

  • 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-03T06:55:46+00:00Added an answer on June 3, 2026 at 6:55 am

    The basic form of your jQuery function should look like this:

    $('#idleReason').change(function(){
        $.ajax({
            url: 'http://www.your.ajax.handler'
            data: $('#idleReason option:selected').html()
        });
    );
    

    You should look up the ajax documentation for more information about how to customize your query.

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

Sidebar

Related Questions

I have written a code which does the thing as the title says. The
I have written some code which compiles fine under linux but on Solaris I
I have written code which saves a user's answers as well as a recorded
I have written a php code which will get one id from database and
I have written code which responds to an image begin clicked by auto clicking
I have written python code which involves the use of dictionaries. I now wish
I have written a code in which i want to open a HTM file
I have written two pieces of code which I intended to have identical outputs,
My code This is the code which I have written. The default function should
I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl

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.