jquery

How to call a function from click event inside another click event function?

烂漫一生 提交于 2021-02-08 09:51:05
问题 I have 2 functions that triggers when an element is clicked. However, i want to use the first function that should be executed in another function via click event. I am still a newbie. I already tried calling the function and declaring the function name inside the other function where i want it to be executed. Is it not working because the first function can only be triggered vie click event on its element? I also nested the click event on a function but it didn't work as well. $(document)

Bootstrap 4 Modal opened by ajax call - close buttons don't work

回眸只為那壹抹淺笑 提交于 2021-02-08 09:43:24
问题 I have a problem with my Bootstrap modals. I am using an $.ajax call, so I can send POST data to a separate .php file, to be displayed in the opened modal. I've been using Bootstrap 3, and I had no bugs, but when I upgraded to Bootstrap 4, my modals will not close. Originally I found techniques that used show.bs.modal here on StackOverflow, as I did my research to build my website. I stripped down my code as simple as I could for testing purposes, so I can replicate it here in this question.

Bootstrap 4 Modal opened by ajax call - close buttons don't work

放肆的年华 提交于 2021-02-08 09:42:51
问题 I have a problem with my Bootstrap modals. I am using an $.ajax call, so I can send POST data to a separate .php file, to be displayed in the opened modal. I've been using Bootstrap 3, and I had no bugs, but when I upgraded to Bootstrap 4, my modals will not close. Originally I found techniques that used show.bs.modal here on StackOverflow, as I did my research to build my website. I stripped down my code as simple as I could for testing purposes, so I can replicate it here in this question.

Submit form after selecting items from multiple dropdown lists - JavaScript

让人想犯罪 __ 提交于 2021-02-08 09:42:43
问题 Here is my HTML <form action="processForm.html" method="post"> <label for="InputOne">Input One</label> <select id="InputOne"> <option val="1">Item</option> <option val="2">Item</option> <option val="3">Item</option> <option val="4">Item</option> </select> <label for="InputTwo">Input Two</label> <select id="InputTwo"> <option val="1">Item</option> <option val="2">Item</option> <option val="3">Item</option> <option val="4">Item</option> </select> <input type="submit" value="Submit"> </form> How

Submit form after selecting items from multiple dropdown lists - JavaScript

天大地大妈咪最大 提交于 2021-02-08 09:42:10
问题 Here is my HTML <form action="processForm.html" method="post"> <label for="InputOne">Input One</label> <select id="InputOne"> <option val="1">Item</option> <option val="2">Item</option> <option val="3">Item</option> <option val="4">Item</option> </select> <label for="InputTwo">Input Two</label> <select id="InputTwo"> <option val="1">Item</option> <option val="2">Item</option> <option val="3">Item</option> <option val="4">Item</option> </select> <input type="submit" value="Submit"> </form> How

jQuery Validation Plugin - 'Required' rule behaving strangely

偶尔善良 提交于 2021-02-08 09:42:07
问题 I'm using this jQuery Validation Plugin (jquery-validate) in combination with Bootstrap, and I already made 5 forms with it & with a lot of pain. I now have this JSFiddle, but my password field is behaving strangely... As you can see, I set the required rule for the password, as for all. If I delete all bullets in my browser and move on to the next field, it is left untouched, if already marked correct, it remains correct, if not marked at all, remains unmarked. It isn't marked incorrect, and

Add class to dropdown option

痴心易碎 提交于 2021-02-08 09:28:14
问题 Here is my html code <select class="input" id="shopperlanguage" name="shopperlanguage"> <option selected="" value="ja_JP">日本語</option> <option value="en">English (International)</option> </select> I want to add two classes to each option like when if value is ja_JP then need to add japImg class and if value is en need to add engImg class to that option. value is by default set and i can not access the code i need to do it by jquery or java script. I have tried this code but its adding classes

Enable CSS slideshow autoplay with JavaScript

偶尔善良 提交于 2021-02-08 09:26:06
问题 I made a simple slideshow using only CSS, where on the radio button click, the margin of the element changes so it displays the desired slide. You can see how it works in the code snippet below. I also made this slideshow auto play with JavaScript. The script checks the next radio button in the list every 3 seconds. Now I need help to make the slideshow auto play in a loop and to also stop auto play when you check any radio button manually . $(document).ready(function() { function autoplay()

drag and drop zone with child nodes

喜你入骨 提交于 2021-02-08 09:22:22
问题 I have a drag and drop zone with multiple child nodes. The main element has dropenter and dropleave events. But if you drag a file inside the main element and over a child node, the dropleave is triggered. How to handle it so the dropleave only is called when the dragged element and mouse is outside the main element? http://jsfiddle.net/4cspcsc4/ <div class="drop"> Drop here <div class="img"></div> </div> $('.drop').on('dragenter', function(e){ $(this).addClass('highlight'); }) .on('dragleave

Django - is_ajax() not returning true

非 Y 不嫁゛ 提交于 2021-02-08 09:15:45
问题 I know there are a lot of questions already asked on this but I am not able to get around with it. Please have a look: from a profile view when "update" button is pressed I want the user to be displayed with an editable form with values picked from database. So as of now there is no POST data. template: <form id="shw-form" action="/update_user_profile/{{r_user.id}}" method="get" enctype="multipart/form-data"> <button type="submit" id="upd-btn" class="btn btn-lg btn-warning" onclick="update