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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:03:58+00:00 2026-05-26T07:03:58+00:00

I have a time picker I built in .NET that is a table format.

  • 0

I have a time picker I built in .NET that is a table format. Each row has a value of a 30 minute time interval. I have implemented the jquery that lets me click on a start time and drag down the list and pick an end time to select a time range. The problem I am running into is the jquery to store the value of the first row that is clicked and store the end time in the last row that was ‘mouseovered’. Here is the jquery so far.

<script type="text/javascript">
$(function () {
    var isMouseDown = false;
    var begintime;
    var endtime;
    $("#BodyLeft_timeTable td").mousedown(function () {
        isMouseDown = true;
        $(this).toggleClass("highlighted");
        return false;
    }).mouseover(function () {
        if (isMouseDown) {
            $(this).toggleClass("highlighted");
        }
    }).bind("selectstart", function () {
        return false;
    });

    $(document).mouseup(function () {
        isMouseDown = false;
        window.location.href = "HoursDetail.aspx";
    });
});
</script>

Here is the link to the pic of where I am going with the time picker. When the mouseup event is fired the first and last times picked are used to redirect to new page and include these two values in the query string.

http://i869.photobucket.com/albums/ab251/bradedwards0978/timepicker.png

Any help would be great.

Thanks.

  • 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-26T07:03:58+00:00Added an answer on May 26, 2026 at 7:03 am

    Hope this works, or you can at least get a good idea of where I’m headed with it.

    //Select all cells that contain the class "highlighted"
    var selected = $("#BodyLeft_timetable td").filter('.highlighted');
    //select first & last for range
    var first = selected.first().id;
    var last = selected.last().id;
    
    var href = "HoursDetail.aspx?first=" + first + "&last=" + last;
    window.location.href = href
    //ex: HoursDetail.aspx?first=0830am&last=0100pm
    

    Scan the DOM for the data cells that are highlighted (as indicated by the css class you applied to them). From that collection, grab the id of the first and last objects. Load up the query string with those id's.

    The only problem I potentially see is that I don’t know if you’ve given each cell in the table an individual ID or if that’s going to present a problem. What you could do is assign each cell with a data-time attribute and a value of 1pm 930am etc and instead of grabbing the .id you can grab .attr('data-time')

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

Sidebar

Related Questions

I have an ASP.NET website that I built that has grown considerably in size
I have a dataset with a column containing date in DAY-MONTH-YEAR TIME format. That
I have a date/time field that I need to have a date/time picker but
I have a form with a field that uses a date/time picker which produces
I have some code that gets two Time Picker's content and displays them individually
I'm working on an application in C# with .Net 3.5. I have time zone
i have a time dropdown that shows hour in one select, minutes in another
I've added a date time picker to a form. Initially its value is set
I have a standard Jquery date picker which shows 2 textboxes. One textbox has
I have a php page which has a chart, a date picker(calendar) and a

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.