Issue encountered when attempting to show two date-pickers on a single HTML page

I have been utilizing this widget from Frequency Decoder for my date picker needs. You can find it here:

Initially, I implemented the widget as follows:

 <input type="text" class="w8em format-d-m-y divider-dash highlight-days-12
 range-low-today" id="dp-1" name="dp-1" value="" maxlength="10" style="width:
 120px;"/>

While it worked perfectly for one date picker, I encountered an issue when trying to include a second date picker in the same .html file. The second input field remained blank with no date picker appearing.

Is there a limitation that restricts the use of this widget to only once per file?

Answer №1

If you want to include a second date-picker in your project, simply give it a unique id and name. In the example below, I have created two date-pickers with different ids (dp-1 and dp-2) and confirmed that they work as expected...

<input type="text" class="w8em format-d-m-y divider-dash highlight-days-12 range-low-today" id="dp-1" name="dp-1" value="" maxlength="10" style="width: 120px;"/>
<input type="text" class="w8em format-d-m-y divider-dash highlight-days-12 range-low-today" id="dp-2" name="dp-2" value="" maxlength="10" style="width: 120px;"/>

For a demonstration of this setup, please visit the following link...

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

Make sure that the two rows in my Bootstrap table are consistently positioned next to each other, regardless of the length of the text

When working with a Bootstrap panel containing text inside a table, I've encountered a challenge. One side features links while the other displays descriptions. At times, I find myself having to artificially lengthen the text to ensure it aligns corre ...

Do not apply styling to a particular page in CSS and HTML

Utilize the teachable.com platform and take advantage of their code Snippets feature (refer to attached photo #1) https://i.stack.imgur.com/dW1lB.png I inserted the following code: div { direction: rtl; } To modify the website's direction to be ...

Encountering obstacles when attempting to save form information to a MongoDB database using Node.js

I've been struggling to save the data entered in my form to my database, but it's not working at all. No errors are showing up and nothing is being logged. Here's the HTML code I'm using: <!DOCTYPE html> <html lang="en"> & ...

The onblur event is triggering prior to the value being updated

There are two input fields within a <form> element. I am trying to retrieve the value of one input field (dpFin) once it has been changed. The issue is that when I attempt to get the new value inside the event using var endDt = document.getElementByI ...

Tips for preserving border-radius while animating the size of an element

I am trying to achieve a carousel indicator animation where the list item pops out to zero radius in a circular shape. However, my current attempt results in the list item animating in a square shape instead. Is there a way to make it appear in a circular ...

Tips for persisting CSS modifications within an $.ajax() request?

My code includes an $.ajax() function that increases the height of a div whenever .comment_form is submitted (via ajax comment). While this functionality works as intended, the new height value isn't saved, causing it to revert back to its original he ...

Retrieve the 'computed' CSS for the entire webpage

We operate multiple websites, each referencing 3-5 CSS files. Some of these files are shared across sites while others are specific to certain pages. Our aim is to streamline the CSS structure by consolidating into fewer files without altering the end res ...

The menu in the Bootstrap navbar is obscured by the HTML select option

One issue I am encountering is with a select option list placed in my body just beneath the bootstrap navbar. The problem arises when I open the select list and then hover over the navbar to access its dropdown menu. I attempted to implement this solution, ...

The validation is unreliable in Django's forms.py

def clean_name(self): valname = self.cleaned_data['name'] if valname[0] == 'S': raise forms.ValidationError('name cannot contain the letter S') return valname # return the value if no error Validation is ...

Retrieving information through ajax and displaying it in a table

<!DOCTYPE html> <html> <head> <title>Fetching API Data and Showing in Table with AJAX</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </head> <body> ...

Modify the width of a div element by clicking on it using Javascript

I need to achieve three tasks onclick: change the display:none property of the element with id="notes_content" to display: block modify the width of the element with id="oct" from 1190px to 550px update the width of elements with class="oct_days" from ...

"Unable to locate any corresponding data entries" message appears while utilizing bootstrap-table within Flask

I am currently working on a website using Flask and I'm trying to load data.json using bootstrap-table. However, I am facing an issue where the table is displayed without any data. Here is the directory structure: index.py templates/ new.html ...

Implementing a see-through layer using CSS

This part of my site features a background image. I am attempting to add a transparent overlay at the top of this section, as indicated by the red highlight. I want to achieve this effect using CSS without directly applying the overlay to the image. The re ...

Using JQuery's div.show() function is causing the fields on my page to resize

I am facing an issue with a hide div that is supposed to show when a checkbox is clicked. The problem I'm encountering is that when the div shows up, the height of the input fields becomes too small. Here is the structure of my div: <div id=" ...

Bootstrap version 5 has a feature where the dropdown menu extends beyond the right side of the screen

I'm facing an issue with the default bootstrap 5 navbar. When I attempt to add a dropdown on the right side, the list of dropdown items extends beyond the screen on the right. You can see the problem here. I've tried the solutions suggested in s ...

Issues with Bootstrap AFFIX and the window onload event not functioning as expected

I am a beginner with bootstrap and I am trying to use affix to make a header stick on top of a page when the user scrolls down. Sticked SECTION HTML: <section class="m-book-now full-width affix" data-spy="affix"> I have successfully achieved this ...

Enclose a group of tiles in a shrinkwrap div

I've been struggling to make a div adjust to its content size here. I've attempted various methods to shrinkwrap it, but none seem to work. <div class="outer"> <div class="cont"> <img src="http://www.placehold.it/100" ...

Using jQuery, organize tables by the value of their td class

, I am attempting to organize various td elements within one or more trs based on their respective classes. These are all housed in multiple table elements with the classname "hosts". Currently, my jQuery abilities are lackluster and I am struggling to sor ...

When the input element's visibility is toggled, the text elements wiggle slightly

I have created a layout that looks like this: <ul id="playlists" class="ui-sortable"> <li data-id="b69c8348-f47c-4156-a975-a2f1009610a8" data-type="3" class="listItem playlist active"><i class="fa fa-list fa-fw"></i> &l ...

monitoring the HTML code post-editing

After using jQuery, I made modifications to the HTML source code by adding several text fields. However, when I check the page source in Google Chrome, it still shows the original source code. Is there a method to view the updated HTML code? ...