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

The Archive Base Latest Questions

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

I am getting values from one textbox and putting it in another textbox. The

  • 0

I am getting values from one textbox and putting it in another textbox. The values being transferred are a question’s duration, and both textboxes use the jQuery timepicker plugin. Now this works for the first textbox but it does not work for the second textbox. I want to include a button next to the second textbox so the user can open up the timepicker just in case the user wants to change the duration in the second textbox.

So I want to include this timepicker function below:

$(document).ready(function() {
    $(function() {
        $('#questiondurationpickerRow').trenttimepicker({
            timeFormat: 'hh mm ss',
            hourGrid: 4,
            minuteGrid: 10,
            secondGrid: 10,
            showOn: 'button',
            buttonImage: "Images/clock.gif",
            buttonImageOnly: true
        });
    });
});

Into the InsertQuestion(form) function below:

var qnum = 1;

function insertQuestion(form) {
    var $tr = $("<tr></tr>");
    var $duration = $("<td class='duration'></td>");

    $('#questiondurationpicker').each(function() {
        var $this = $(this);
        var $durationText = 
            $("<input type='text' id='questiondurationpickerRow' readonly='readonly' />")
                .attr('name', $this.attr('name'))
                .attr('value', $this.val())

        $duration.append($durationText);
    });

    $tr.append($qid);
    $tr.append($duration)
    $('#qandatbl').append($tr);

    form.numberOfQuestions.value = qnum;

    ++qnum;
    $("#questionNum").text(qnum);
    form.questionText.value = "";
}

What it is suppose to do is to display the timepicker button I have created next to the “#questiondurationpickerRow” textbox so that the user can click on the button and open up the timepicker to open up the duration.

I tried to put the “questiondurationpickerRow” timepicker function in the insertQuestion(form) function but it does not display the button. Below is what I tried:

var qnum = 1;

function insertQuestion(form) {
    $(document).ready(function() {
        $(function() {
            $('#questiondurationpickerRow').trenttimepicker({
                timeFormat: 'hh mm ss',
                hourGrid: 4,
                minuteGrid: 10,
                secondGrid: 10,
                showOn: 'button',
                buttonImage: "Images/clock.gif",
                buttonImageOnly: true
            });
        });
    });

    var $tr = $("<tr></tr>");
    var $duration = $("<td class='duration'></td>");

    $('#questiondurationpicker').each(function() {

        var $this = $(this);
        var $durationText =
        $("<input type='text' id='questiondurationpickerRow' readonly='readonly' />")
            .attr('name', $this.attr('name'))
            .attr('value', $this.val())

        $duration.append($durationText);
    });

    $tr.append($qid);
    $tr.append($duration)
    $('#qandatbl').append($tr);

    form.numberOfQuestions.value = qnum;

    ++qnum;
    $("#questionNum").text(qnum);
    form.questionText.value = "";
}

How can I include the “questiondurationpickerRow” timepicker function in the insertQuestion(form) function so that it will display the timepicker button next to the textbox?

  • 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:45:24+00:00Added an answer on May 27, 2026 at 7:45 pm

    for this:

    function insertQuestion(form) {
         $(document).ready(function() {
             $(function() {
                 $('#questiondurationpickerRow').trenttimepicker({
    

    all you need is:

    function insertQuestion(form) {
       $('#questiondurationpickerRow').trenttimepicker({
    

    I do not see a definition

    $tr.append($qid);   
    

    of $qid

    an it is hard to guess what the ).trenttimepicker does really.

    EDIT:

    Looking at:

    $('#questiondurationpicker').each(function() {
         var $this = $(this);
         var $durationText =
              $("<input type='text' id='questiondurationpickerRow' readonly='readonly' />")
                 .attr('name', $this.attr('name'))
                 .attr('value', $this.val())
          $duration.append($durationText);
     });
    

    This makes more sense (and fix syntax error)

    to do as:

       $this = $('#questiondurationpicker');
       var $durationText = $("<input type='text' id='questiondurationpickerRow' readonly='readonly' />")
           .attr('name', $this.attr('name'))
           .attr('value', $this.val());
       $duration.append($durationText);
    

    re: missing semi-colon
    only ONE element can be present with a given ID so no need for each() stuff

    final rework:

    var qnum = 1;
    
    function insertQuestion(form) {
        var $tr = $("<tr></tr>");
        var $duration = $("<td class='duration'></td>");
    
        $this = $('#questiondurationpicker');//assume this exists
        var $durationText = $("<input type='text' id='questiondurationpickerRow' readonly='readonly' />").attr('name', $this.attr('name')).attr('value', $this.val());//was issing semi colon
        $duration.append($durationText);
    
        $tr.append($qid);//assume $qid exists and is an element
        $tr.append($duration) $('#qandatbl').append($tr);
        form.numberOfQuestions.value = qnum;//another assumption
        ++qnum;
        $("#questionNum").text(qnum);// assume this exists
        form.questionText.value = "";//assume this exists
    
        // This has to be after it gets inserted
        $('#questiondurationpickerRow').trenttimepicker({
            timeFormat: 'hh mm ss',
            hourGrid: 4,
            minuteGrid: 10,
            secondGrid: 10,
            showOn: 'button',
            buttonImage: "Images/clock.gif",
            buttonImageOnly: true
        });
    }
    

    Here is a page with a sampe using jQuery UI datepicker:
    http://jsfiddle.net/MarkSchultheiss/Mykd6/

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

Sidebar

Related Questions

I have one jsp which accepts avlue from textbox and passes it to another
In SQL server, I am trying to insert values from one table to another
I've got a question about getting the values from a constructor in a generic
i'm sending values from one page via jquery's ajax to a php page. I'm
I'm getting odd behavior (it generates only missing values) from the following loop -
So I've been getting some mysterious uninitialized values message from valgrind and it's been
I have designed one sign-up form,in this form after getting all necessary values I
Is there any built-in functionality in vba to get unique values from a one-dimensional
In the SQL Server, I am trying to insert values from one table to
I'm trying to string concatenate multiple row values from one table using Coalesce, separated

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.