Topic: issue with data-mdb-countdown-init
cleanentries priority asked 10 months ago
I am trying to use the countdown timer. When I add the attribute data-mdb-countdown-init to my div I get a visual studio squiggle message that shows "This attribute name must be followed by an equal (=) sign and a value." When I try to run the app, the markup shows up as data-mdb-countdown-init="" It adds the ="" to the attribute. The timer does not show at all in the resulting page.
I have the div in a repeater: Fee Event Name '>
I have seen this issue with other mdb markup (like the collapse control) when trying to add data-mdb-*-init attribute. I get the same issue. What is going on? How do I get this to work??
The repeater is in a content page. My master page has the following in the head tag:
cleanentries priority answered 10 months ago
Any ideas ... anyone ??... Bueller ?
Grzegorz Bujański staff commented 10 months ago
I was looking for a solution, e.g. on stackoverflow. And it looks like you have an XHTML standard set in your project. From the information I found, the solution I provided should work. Maybe you have some additional rules set?
cleanentries priority answered 10 months ago
Adding ="true" does make the error go away but the timer does not show up on the page at all. If I inspect the html I can see the timer markup but the divs have no values. The markup I see on the page on inspection looks like the following (which is exactly what I have as the markup as well:
<div data-mdb-countdown-init="true" data-mdb-countdown="20 June 2024 12:59:59">
<div class="countdown-unit countdown-days"></div>
<div class="countdown-unit countdown-hours"></div>
<div class="countdown-unit countdown-minutes"></div>
<div class="countdown-unit countdown-seconds"></div>
</div>
Looking at Console there are no errors. This markup is in the content section of a child page. Are there issues showing this in a content section?
Grzegorz Bujański staff commented 10 months ago
The error you mentioned above says that the attribute must have a value. Are you getting the exact same error now? The solution I provided is to pass value to the attribute, so it should solve this problem
cleanentries priority commented 10 months ago
I have tried data-mdb-countdown-init="true" and also data-mdb-countdown-init="data-mdb-countdown-init" and I get the same issue. It doesn't work. I just tried to copy paste a tab navigation example, line for line, and I get the same squiggle error and the tabs do not work. When I click each tab I can see the url change but the tab content does not change. This is frustrating.
Grzegorz Bujański staff answered 10 months ago
I assume it's a matter of visual studio settings or your project. The simplest solution is to add the value "true"
- data-mdb-countdown-init="true"
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.4.2
- Device: PC
- Browser: Firefox
- OS: Windows 10
- Provided sample code: No
- Provided link: No