I looked up online how to determine if a modal form is open on Bootstrap, so I wrote the following line of code:
console.log($("attributesModal").hasClass('in'));
which provides me with the following error: Uncaught ReferenceError: $ is not definedsubmitIncidentReport @ main.js:228(anonymous function) @ main.js:299
I want to determine which form is entered to run a block of code to insert data in the database based on the open modal form.
Solved! Go to Solution.
Is "attributesModal" a class or an id?
If class use something like:
query(".attributesModal .in")
If it's an id, you might want to use dojo/dom-class:
domClass.contains("attributesModal", "in");
Tom
Are you using Dojo-Bootstrap? If so, that's why $ is not defined b/c, there's no jQuery on the page. You can achieve the same w/ dojo/query
Another idea would be for each for submit or button click to call different methods. so you don't have to check which one called it,
I 'm using your app that I converted. so what would I write? It doesn't look like .hasClass('in)); works.
Is "attributesModal" a class or an id?
If class use something like:
query(".attributesModal .in")
If it's an id, you might want to use dojo/dom-class:
domClass.contains("attributesModal", "in");
Tom
It was indeed the id. Now I can evaluate which form I want to insert data from. The app will now have two layers. Thanks Tom Wayson !