What is the best way to adjust the width of a time picker element?

Here is the code snippet that I have utilized:

<link rel="stylesheet" 
      href="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css">
<script 
      src="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js">
</script>

<script>
  var time = "9";

  $(function() {
    $('#itime').timepicker({
      minTime: time,
      maxTime: '7:00pm',
      'timeFormat': 'H:i:s'
    });
  });
</script>

<div class="input-group" style="margin-top: 10px;" onclick="shwtmpkr()">
  <input type="text" id="itime" name="itime" class="form-control" 
         placeholder="Booking Time" style="background-color:white" /> @*
  <input type='text' id="rTime" name="rTime" class="form-control" placeholder="Booking Date" 
         style="background-color:white" readonly="" />*@
  <span class="input-group-addon">
    <span class="fa fa-clock-o"></span>
  </span>
</div>

Answer №1

Adjust the width of the input element.. width:80px

 var time = "9";

  $(function() {
    $('#itime').timepicker({
      minTime: time,
      maxTime: '7:00pm',
      'timeFormat': 'H:i:s'
    });
  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js"></script>


<div class="input-group" style="margin-top: 10px;" >
  <input type="text" id="itime" name="itime" class="form-control" placeholder="Booking Time" style="background-color:white;width:80px" /> @*
  <input type='text' id="rTime" name="rTime" class="form-control" placeholder="Booking Date" style="background-color:white" readonly="" />*@
  <span class="input-group-addon">
    <span class="fa fa-clock-o"></span>
  </span>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guidance on retrieving a boolean value from an asynchronous callback function

I'm looking to determine whether a user is part of a specific group, but I want the boolean value returned in the calling function. I've gone through and debugged the code provided below and everything seems to be working fine. However, since my ...

What is the best way to use jQuery to filter data in a table by clicking on a specific table row?

My website contains a table with player names and servers, but I want to make them clickable for filtering purposes. For instance, clicking on a player name should reload the leaderboards to show which servers that player plays on, and clicking on a server ...

How can we retrieve the newly generated data in node.js after refreshing the page?

Currently, I am utilizing a webservice call to retrieve JSON data. After making a restful call, the newly generated data is saved in the traffic.json file. However, in node.js, upon submission, I encounter a situation where I am unable to fetch the fresh ...

<use> - SVG: Circles with different stroke properties

Why is the stroke of both <use> elements being ignored here? The stroke color of <circle> is set to blue, which is also appearing on both <use> elements. Why? I am trying to set different stroke colors for all three of these elements, bu ...

Attempting to create an animated carousel slider

I've been working on creating a carousel animation that displays 3 images, slides them to the left, and brings in new ones. I'm feeling a bit stuck and could use some assistance. Check out my work so far on this fiddle link: http://jsfiddle.net/ ...

What are the steps to modify the MIME type in order for the browser to correctly display a CSS

I'm encountering an issue where my CSS code is not rendering in the browser, and it seems to be related to MIME types (which I'm not familiar with). I am using EJS as a template engine. The error I see in the console is... Refused to apply sty ...

Transferring the ID value from a button in the template to a Django View

Currently in my second week of diving into Python and Django for a little project, but running into some JavaScript roadblocks. My knowledge of JS is limited, so I could really use some guidance. I'm looking to pass the ID (the "Value" within the but ...

Ways to customize the CSS of a website specifically for mobile browsers

I recently made some tweaks to the dropdown menu design on my website, and now it looks much better on mobile devices with a aqua light green/blue header color and #333 text in the dropdown. However, when I switch back to the desktop version, the entire me ...

Find the most recent date in a file and display the line associated with it

I am working with a document named Application.txt that consists of multiple columns and rows as shown below: ApplNo DocsURL DocDate 4782 www…. 7/28/2003 4782 www…. 11/23/2008 4782 www…. 3/24/2012 5010 www…. 4/5/2003 5010 ww ...

Steps to create an iframe that opens in a new window

I'm facing an issue with the iframe sourced from flickr. My website includes an embedded flickr iframe to showcase a gallery without the hassle of creating a slider, resizing images, and extracting thumbnails. Given that this site belongs to a frien ...

Load media upon the click of an image

I'm currently in the process of designing a team page for our website. Each team member's photo is displayed in a grid layout, with two boxes positioned below containing various content. Box 1: This box consists of basic text information. Box 2: ...

When trying to load an ASPX file with jQuery UI Tabs, pressing the ASP button results in an error message saying "page not found."

I am a newcomer to the world of jQuery and AJAX, facing an issue with implementing jQuery UI tabs. The problem arises when I load separate .aspx pages into each tab and try to carry out regular processing tasks without reloading the entire page. Currently, ...

The Ajax Form disappears from the page

After racking my brain for a while, I've come to the conclusion that it's time to seek some assistance. I have work tomorrow and I don't want to spend all night on this. The issue lies in my form which is located inside a modal, here is my ...

Warning: HTML input values are being cleared when added

I've been working on some code that adds an input field when a button is clicked. When the limit reaches 5 (counter), it displays a bootstrap warning. The issue I'm facing is that after hitting "add field" more than 5 times, the values in the fie ...

Checkbox: Activate button upon checkbox being selected

On my webpage, I have a modal window with 2 checkboxes. I want to enable the send button and change the background color (gray if disabled, red if enabled) when both checkboxes are selected. How can I achieve this effectively? HTML: <form action="" me ...

What is the best way to design three flexible divs using display: table without the use of JavaScript?

https://i.sstatic.net/bEC4Y.png Is it possible to create a responsive layout with three divs that behave in the following way: When the viewport is narrow, the three divs stack on top of each other When the viewport is average, the first div spans full ...

Is it possible to apply alternate row colors to elements other than tables, such as div tags?

After encountering issues with my Handlebars template, I decided to create rows without using a table. Now, I am looking to implement zebra stripe CSS and wondering if that property can be applied universally. Thank you for your help. ...

Text displayed in two columns with a circular image positioned in the left column

https://i.sstatic.net/52mhN.jpgI am attempting to create a layout with two columns of text and a rounded image in the upper left corner of the left column. Here is what I have so far: <div class="photoside-left"> <img class="photo" src="http://v ...

What is the process for verifying the ongoing sessions within a particular set of classes?

I have a list of 10 items with varying active classes based on user interactions. I need to determine the number of sets of 3 consecutive active classes within the list. In the given example, there are 2 sets of 3 consecutive active classes: 4,5,6 and 8,9, ...

Delegating events with .on('click') and using the CSS negation selector :not()

Struggling to implement event delegation for a dynamically added or removed class? I need to create an event for elements that are clicked, but without a specific class. Here's the code I have so far, but it doesn't seem to be working. Could it b ...