I have JavaScript that displays a confirmation dialog to the user to confirm their actions with the variables passed in.
However, I have to change the usual confirmation dialog to twitter-bootstrap-modal.
I tried several times, read a lot of SO posts and read twitter bootstrap tags, but I can't get it to work, as my js knowledge is not good enough. I am obsessed with displaying variables in boottrap modal twitter.
I hope someone can help me by pointing me a few pointers.
Here is my current js dialog code:
function checkboxUpdated(checkbox, count, label, id) { if (checkbox.checked) { $('#menu_entry_' + id).show(); } else { if (count > 0) { if (! confirm('{% trans "You have '+ count +' saved '+ label +'.\n\nIf you leave this option un-checked your saved '+ label +' will be deleted only after you update this page.\n\nAre you sure you want to delete your ' + count + ' saved ' + label +'?" %}')) { checkbox.checked = true; return; } } $('#menu_entry_' + id).hide(); } }
EDIT: ADDED #menu_entry_ CODE, as stated in the comment:
{% for id, menu_entry, selected, item_count in menu_entries %} <li id="menu_entry_{{ id }}" {% if not selected %}style="display:none;"{% endif %}> <a {% if id == 4 %} href="{% url summary_details %}" {% elif id == 8 %} href="{% url objective_details %}" {% elif id == 12 %} href="{% url leading_employment_details %}" {% elif id == 16 %} href="{% url desired_occupation_details %}" .... {% elif id == 112 %} href="/" {% else %} href="/" {% endif %} onclick="showProgressAnimation();">
Please note that I need to convert the following js verification code to tweet modal download code:
if (! confirm('{% trans "You have '+ count +' saved '+ label +'.\n\nIf you leave this option un-checked your saved '+ label +' will be deleted only after you update this page.\n\nAre you sure you want to delete your ' + count + ' saved ' + label +'?" %}')) {
javascript jquery twitter-bootstrap modal-dialog confirm
user1261774
source share