The datetime picker feature in bootstrap seems to be malfunctioning

I'm struggling to incorporate a Date Time input system into my bootstrap form. I've tried multiple examples, but none seem to be working for me.

Now, I came across this site and attempted to implement their solution, but still no luck:

<div class="input-append date form_datetime" data-date="2013-02-21T15:25:00Z">
    <input size="16" type="text" value="" readonly>
    <span class="add-on"><i class="icon-remove"></i></span>
    <span class="add-on"><i class="icon-calendar"></i></span>
</div>

<script type="text/javascript">
    $(".form_datetime").datetimepicker({
        format: "dd MM yyyy - hh:ii",
        autoclose: true,
        todayBtn: true,
        startDate: "2013-02-14 10:00",
        minuteStep: 10
    });
</script> 

Can anyone provide some guidance on what steps I should take next?

Answer №1

You've assigned the class form_datetime to a div element, but the datetimepicker should actually be applied to an input text box. The URL you provided also confirms this.

The form_datetime class should be used on the textbox, not the div element.

To correct this, follow the example below:

<div class="input-append date" data-date="2013-02-21T15:25:00Z">
    <input size="16" type="text" value="" readonly class="form_datetime">
    <span class="add-on"><i class="icon-remove"></i></span>
    <span class="add-on"><i class="icon-calendar"></i></span>
</div>

<script type="text/javascript">
    $(".form_datetime").datetimepicker({
        format: "dd MM yyyy - hh:ii",
        autoclose: true,
        todayBtn: true,
        startDate: "2013-02-14 10:00",
        minuteStep: 10
    });
</script> 

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

Automatically filling in related information in multiple input fields after choosing a value in a specific input field using JavaScript

My horizontal form is dynamically generated using JavaScript, with each input field having a jQuery autocomplete that retrieves data from a database using the $.get method. I'm looking to automatically populate the second input field with the corresp ...

What is the best way to include a new css class in the surrounding tag when using Sitecore's MVC HtmlHelper for fields?

My goal is to display the content of @Html.Sitecore().Field(TPage.Headline) within an <h1 class="page-heading"> tag only if it contains a value. I do not want to render the surrounding <h1 class="page-heading"> tag when the field is empty. Alt ...

Looking to make the Bootstrap navigation bar fixed when scrolling down

Can someone help me fix this bootstrap code to stay fixed at the top of the webpage while scrolling down? Below is the bootstrap code that I currently have. I need assistance in making it change from a static position to a fixed one as users scroll down t ...

gulp-webpack encountered an error: The entry module could not be found. Error: module resolution failed

Whenever I attempt to run gulp scripts, it gives me the following error message: ERROR: Entry module not found Error: Unable to resolve 'C:/Users/milan/Local Sites/project-university/app/public/wp-content/themes/fictional-university-theme/js/scrip ...

Enlarge the picture using just a singular image

My objective is simple: I want to magnify an image. Most JavaScript scripts I've found online require two images (one for thumbnail size and one for the zoomed-in size). But what if I only have one image? Is it still possible to achieve the zoom effec ...

Basic Java HTML parser for extracting CSS attributes

Is there a way to parse the style attribute of a basic <font> tag and then convert it back to simple html attributes? For example, if I have this string <font style="font-family:tahoma;font-size:24px;color:#9900CC;">, is it possible to convert ...

How to modify the overlay color in the TouchableHighlight component using an arrow function in React Native

With touchableHighlight, I found that I could easily modify the overlay color using the following code: <TouchableHighlight onPress={this.toggle.bind(this)} underlayColor="#f1f1f1"> However, when attemptin ...

What is causing this substring to not function properly in Chinese text?

What could be causing this issue with the substring function when dealing with Chinese text? I have successfully used it for other languages, but when working with Chinese characters, I am getting an empty string as a result. countryID = "奥地利 ...

Gradient background overlaid with a blended SVG shape

Creating a full gradient background with a clipping mask can be tricky. I used an SVG to achieve the desired shape by cutting part of the background color, but now I'm facing a challenge with blending the colors seamlessly. I tried setting the SVG co ...

ReferenceError: processForm has not been defined and was not caught

Is it possible to trigger a form from outside the form itself? I have an Angular form using Bootstrap, and I'm looking for a way to call it externally for design purposes. Can you provide guidance on how to achieve this? <ul class="navbar-nav"& ...

Attempting to establish limits for the movement of a three.js cube

I'm currently working on developing a straightforward app that allows me to move a cube either to the left or right. The movement part has been successfully implemented, and now I am faced with the challenge of ensuring that the cube stays within the ...

Unable to utilize await within a then statement to make a subsequent API call in a React application

Here is my scenario: I am making a call to one API, and in the `then` section of that API call, I am making another API call. The output of the first API will be passed as input to the second API. await axios .post(process.env + '/certificates/uplo ...

Storing various information using the asynchronous capabilities of Node.js and MongoDB

I have an array of IDs: var ids = ['53asd3','53asd2','53asd5']; Each ID corresponds to a document in MongoDB. I would like to create an object by retrieving data from each of them and saving it into another document. For exa ...

Error message in Angular 2, Problem found in inline template while utilizing eval() function

<li *ngFor="let pdfifRecord of pdf.ifRecord;let i=index"> <p>{{eval(pdfifRecord.labelMsg)}}</p> </li> I need to show the output of the eval function. Encountering an error message: Error in inline template c ...

Create an animation where an element glides smoothly over the others, extending to a specific width

How can I make a table of headings stretch to the width of the table and then slide down over the others when one of the headings is clicked? I want the heading to return to its original state when clicked again or when another heading is clicked. Here&ap ...

The Skeleton-Avatar and ImageButton components in MUI React have had their backgrounds reshaped into perfect ovals

I am facing an issue with the mui Stack where all the background shapes of the Skeleton Avatar and background area are turning into oval or ellipsoid shapes. I have tried setting equal width and height for Avatar but it has not solved the problem. Is ther ...

Experiencing an unusual issue with grunt: The Gruntfile.js seems to be missing the 'flatten' method

Encountering an unusual error message while attempting to run grunt stated: TypeError: Object Gruntfile.js has no method 'flatten' Being a beginner with node.js, npm, and grunt, I believe my installation of node, npm, and grunt was done correctl ...

Fails to steer towards a relative callback URL

I'm having trouble understanding the NextAuth documentation for my specific requirement. I need users to be redirected back to the protected page they were on after logging in. My website is multilingual and built with NextJS locale. I'm using G ...

Guide to building a seamless page without refreshes with the help of jquery, express, and handlebars

I need assistance with my express JS project. I am trying to set up two pages using NodeJS, incorporating handlebars as the template engine. My objective is to have the first page rendered using res.render('home'), and for the second page to be l ...

"How can I update a table in Flask using Chart.js and Pandas

I have developed a basic Flask application that includes a bar chart using Chart.js and a data table displayed below it. Check out the setup below: https://i.sstatic.net/QB6jQ.png (Live view: ) The bar chart I created counts the number of items for each ...