Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to disable the previous date for a input date field(ejs file) in my project,code in main entry point
and
and calling this function from the ejs file. i am getting an error that "$ is not defined".How can i fix this issue?.please help. Ta




What I have tried:

JavaScript
<pre>app.locals.deactivateDate = () => {
let today = new Date().toISOString().split('T')[0]

$('#taskDueDate').setAttribute('min', today)
$('#date_picker').setAttribute('min', today)
} 
Posted
Updated 27-Jul-21 7:39am

1 solution

$ is not defined means that jquery has not been loaded so the browser's javascript parser does not know what $ is.

You'll need to make sure that jquery is loaded before this code tries to run.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900