Problem with dynamically appended elements
I am creating something like a shopping-cart in yii2 . Here is my code: $('body').on('click', '#materials li', function () { let hidden = $('[value=' + $(this).attr('data-id') + ']'); console.log(hidden); if (hidden.length > 0) { return false; } else { $('#materials-form').append('<input type="hidden" name ="Materials[' + $(this).attr('data-id') + ']" class="hiddenInput" value="' + $(this).attr('data-supplier') + '"/>'); $('#materials-form').append('<li>' + $(this).text() + '<button data-id = "'
Passing in two variables to onclick
I have a PHP script which is looping through a database result. Each row will create a link <a href="#" class="mylink"><?php echo #PHP; ?></a> I'll then have a jQuery, for the mylink onclick even to call a page. On I need to pass into the even two vairbales from my row, an ID, but also a date string. mylink('34, '2015-05-08'); for example, but it's that the syntax for a JS on click even.
Use jquery variable as part of html link
Dear sir / madam var mob1=$(''#mob1').val(); var url= "mobilememberidfill.php"; data = { mob1: mob1 } $('# mobilememberiddiv').load(url,data,checkmobileexists) ; Above ajax gets me ID of the mobile number stored in DIV with id mobilememberiddiv in this case, (when mobile number exists), i get its ID from var id = $('# mobilememberiddiv').text(); and in this case i want to display message $('#mobilemessagediv').html("Mobile Number Exists!! <br> <a href='payfees.php?id=ID'' > Cilck to make
HTTP400:INCORRECT QUERY
hello , I have a problem for 3 days on an HTTP request of type $. AJAX {()} I explain my code: the data I have are : headers : Content-Type = application/json body :{ "UserName": "trinita", "Password": "112A" } my request http is: jQuery.ajax({ url: data.npsod.conn.server+'Account/Login', method: 'POST', contentType: 'application/json', dataType : "json", data:{UserName:"trinita",Password:"112A"}, xhrFields: { withCredentials: false }, error:
Calculate mouse position after zoom ?
Hi I'm using a jQuery plugin to create a flowchart, this allows you to create links between connectors. This all works well but I've needed the ability to zoom on the flowchart, so I've used jQuery UI animate zoom and that seems to work fine. When I click on a flowchart connector a temp link is generated that follows the mouse pointer until you click the final connector and the link is made.. Currently the temp link is not in line with the mouse pointer when a zoom is applied. It appears that when
datepicker UI Arrival and Departure Fields
I have a WordPress form on my client's hotel website with an arrival field and a departure field. The client wants the departure date to add +1 day to the minDate when a user selects the arrival date. I have tried adding +1 to several areas but nothing seems to work. I have attached the script I am using (it's using jQuery instead of $ because the form is in a code block in WordPress). I have searched several forums and Google searches with no success. <script> jQuery(function() { var dateFormat
Each event is not firing
I have included a jQuery file in my template, and it loads perfectly. But when I am trying to implement each function, it doesnt fire that event. I am writing some jQuery code for Salesforce Commerce Cloud SFRA. Whereas the same script works for other DOM elements on other platforms like JS Fiddle and Chrome Devtools. This script is provided in a catridge by Paypal, so I just need to integrate the cartridge and it will work, but here I am having trouble because each event is not working. Is there
Insert code to auto-refresh current webpage every 120 seconds?
Assume I load a web page which is occasionally updated on the server (=not under my control). To get the updated information I always have to click refresh in my browser. This is unhandy. How can I automatize that? I can imagine that there is a jQuery/javascript/CSS code which I can insert and which tells the browser to automatically update the loaded webpage every e.g. 120 seconds. How does that work in detail? Thank you Peter
clicking on an item adds item 3 times for 3 items in while loop
Hi, I am building a sticker app that a user clicks a sticker and it adds to the HTML 5 canvas. At the moment, when you click on a sticker it adds it, GREAT! If you click it again it adds it the amount of times how ever many items that have the class sticker So if there are 3 items that have the class sticker they all get added, I only want to add 1 item when I click on one item, please help? HTML + PHP <?php while ($row = $statement->fetch()) { ?> <div class="sticker"> <input type="hidden"
How to solve/fix JSON.parse problem dealing with duplicates
Hi all I seem to be facing this problem : JSON syntax duplicates This is the source xls file format: This is the JSON : [{"Registrant ID":"22722608","Registrant Date":"09/18/2018","Last Name":"Armstrong","First Name":"Conor","Email":"conor.armstrong@testco.com","Username":"conor.armstrong@testco.com","Company":"TEST CO","Department":"","Title":"","Attendee":"No","Status":"Enrolled","Section":"","Location":"place online"},{"Registrant ID":"22722608","Registrant Date":"09/18/2018","Last Name":"jenkins","First
Problem getting the value of an element
Hi, I'm new as you can tell by my question. What is wrong with this code? function bt(ans){ $(document).ready(function(){ if (ans==1) { if ($(".hidn1").val()=="") { alert(ans); $(".msg").text("\n\nWhachu gonna have?"); }); } } Here is the call: <button id="bt1" style="background-color:green; color:yellow; height:20px; width:20px;" type="button" onclick="bt(1)"></button> And here is where the elements are defined: <textarea id="hidn1" cols="1" rows="1" style="display:none;"></textarea>
Problem in select 2 library for select item
I using select2 but I have a problem For example in select box I have two items and i set selected attribute for second item When page loaded I look at the select box, the value of the first item is displayed But when I open select box the second item selected What is problem?
Trasnmit url parameters via ajax
I want to transmit a parameter (path of images) to a page using anythingSlider witch load e series of images. this html page work fine. But when i call from another page that not work. I have two pages: the fisrt page do; $.ajax({ type: "GET", async: false, cache: false, contentType: "application/json; charset=utf-8", url: 'Slider.html?name=appart/imgs', dataType: "html",
How do I create a table to show calculation of hours worked in 24 hours format using PHP and JavaScript, Jquery?
Hi, hope I can find the help I need with a website programming project. I'm working on a new website and need to create a time table of hours worked in 24 hours format using PHP and JavaScript (Jquery). In short, the table should layout the days of the week and hours worked and be able to generate the total hours worked at the end of each day and week. EX: Hours Worked 03:20:00 09:30:00 Total: 12:50:00 Any and all help is appreciated. Thanks, JB
undefined is getting displayed through jquery
I have a PHP function which takes 3 parameters GroupId, Year and Month and checks in the database whether there are records less than the selected year and month for groupId and which returns database records. In my case only one record is returned. I am using json_encode(). Data is correctly displayed in json format but undefined is returned when I call this method using $.post() as described below: public function actionGroupsavinginfo($id,$year,$month) { $group = Yii::$app->db->createCommand('SELECT
ajax syntax problem
I want to pass data through ajax to controller but I unable to get that data can any one please tell me syntax for that. I using ajax inside the Jquery Datatable
3.4.1 missing from ajax.googleapis.com CDN
Don't know where to report this, but it seems like 3.4.1 did not get published to ajax.googleapis.com Works: http://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js Does not Work: http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
want to copy dragable element. But my code is cutting the element and pasting it on the dropzone
I am using this to drag and drop element $(".drag-able").draggable({ appendTo: "body", cursor: "move", helper: "clone", revert: "valid" }); $(".drop-able").droppable({ tolerance: 'pointer', drop: function (event, ui) { $(this).append($(ui.draggable)); }, }); but it disappearing the original element. I want to drag the element to a new position by keeping the original one on its position. Is this possible?
Changing hidden field if any checkbox is checked
I've obviously got something wrong here. How do I pass a "interestsYes" or "interestsNo" to a hidden field based on whether any of eight checkboxes are checked? Here's what I have, which basically says, "If any checkbox is checked, set the hidden field "interestAny" to "Yes". If no checkboxes are checked, set the hidden field "interestAny" to "No". $(document).ready(function() { if ($("#clientForm input:clientInterest:checked").length > 0) { $('#interestAny').val($(this).val('Yes')); } else { $('#interestAny').val($(this).val('No'));
Jquery-UI draggable: Problem with “over” and “out” event when droppable changes size dynamically
I'm working on a project whare I need to allow drag and dropping from a sidebar to some content. It is very important, that the content (when hovering it with the draggable) expands with applying some padding (to the inner content, in the example code an image). When I enter the droppable with the draggable, the padding is added, which makes the droppable a bit bigger in size (both width and height). Jquery UI does not "recognize" this change in size, it means that when I move the draggable a bit
how to get ID value from class?
I have 5 images in my console, I am getting undefined badge_img1 undefined badge_img1 undefined badge_img1 undefined badge_img1 undefined badge_img1 I'm expecting t o see: badge_img1 badge_img1 badge_img2 badge_img2 badge_img3 badge_img3 badge_img4 badge_img4 badge_img5 badge_img5 here is my html: <?php while ($row = $statement->fetch()) { ?> <div class="sticker"> <input type="hidden" class="stickerid" id="<?php echo $row['stickerid'];?>"> <input type="hidden" class="path" id="<?php
Safari - jQuery dragging with “filter: drop-shadow()” leaves traces
I have a <div>, that can be dragged using jquery draggable. This action leaves traces in Safari, but works in other browsers. Found similar (old) issues in Chrome regarding repaint, proposing solutions to use outline:1px solid transparent but hat does not help here. This question is also asked on stackoverflow but no answer so far: https://stackoverflow.com/questions/53208588/safari-jquery-dragging-with-filter-drop-shadow-leaves-traces You can see a demo here (open it in Safari): https://jsfiddle.net/qzLjcagt/
video time update events
Hi please note this is designed for touch screen devices only at the moment although it should work with your mousewheel. I've successfully gotten a nice video scrubbing action going here: (please note you have to swipe the screen or roll the mouse wheel to activate) http://www.mediaflash.ca/swipe_video_timeline/index.html this relies on scroll position to scrub the video timeline. At the time update we see the animation event occur. (divs animate and are displayed) however I cannot figure out how
load() function problem
Is there any possibility to load collapsible set from external html page to panel on main page without html header on external html page? When I create external html page without header (js and css files) and load it into div on the index.html, the loaded content ignores js and css from index.html page. Because it needs "data-role=page" div on external html page, but i do not want to have "data-role=page" on external html page. I need only the collapsible set.
The value of the property '$' is null or undefined, not a Function object
Hi all I am pretty new to using J query. I keep getting this error in IE but my code works just fine in code. How do i remedy it? <head> <!-- Remember to include jQuery :) --> <script type='text/javascript' src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script> <!-- jQuery Modal --> <script type='text/javascript' src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css"
Sort list item by it's value
So if I have a list like this <ul> <li>2</li> <li>4</li> <li>1</li> <li>3</li> </ul> How can I sort them so they end up like: <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> ?
autocomplete separated words
I have an autocomplete input with an array of elements with the following format citi-state, for example miami-florida Id like to permit the user to find the city and state in different orders, for ecample: miami fl florida mi How do I configure the autocomplete for this? Thanks a lot, Programador Ari
jQuery Mobile Security Issue
Has anyone got any comments about the jQuery Mobile Security Issue mentioned here ? https://github.com/jquery/jquery-mobile/issues/8640
Exception of focus event after upgraded to 3.4.0
It will get a exception after a focus event sometimes. Appears after upgraded to 3.4.0.
Upgrading JQuery Versions - Finding / Identifying / Correcting
Good Evening Everyone, I should first start with I am on the Security side of the house and hoping to help my development side a bit (While they are helping me of course). From a PCI Scan we have been working on correcting a. jQuery Core rquickExpr variable with Cross-Site Scripting Vulnerability, CVE-2012-6708 b. jQuery Cross-Domain Asynchronous JavaScript and Extensible Markup Language Request Cross-site Scripting Vulnerability, CVE-2015-9251 This has primarily been finding, replacing
Ajax photo uploader only works when I add debugger;
when I step through the debugger in Chrome browser, my image actually uploads and inserts into the database otherwise it doesn't seem to get into the saveDesign.php Please help? $("#sub").click( function(){ debugger; var canvas = document.getElementById('canvas'); //var context = canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true}); var dataURL = canvas.toDataURL({format: 'png' }); document.getElementById("canvas").src = dataURL; $.ajax({ type: "POST",
Clicking on sortable item prevents input's on change event
I am having an issue where if the user types in an input but doesn't leave the input before clicking on a sortable item, the change event for the input does not fire. Here's a jsFiddle that shows the issue. Any suggestions or is this a bug? Thanks, Reid
I can't understand- He assigned value to a varaible.The value is geeting from the find method . He checked 2 conditions .one for selected length and one for image length.Explain please.Thankyou
$('#image-selections .image-selection-row').each(function(index, selection_row){ var row_index = $(this).data('select-index'); var $selected = $(selection_row).find('.image-select.image-selected'); if( $selected.length ){ var $light_img = $('#image-bar-container img.img-flash[data-img-index="'+row_index+'"]'); if( $light_img.length ){ $light_img.attr('src', 'folder/im-' + $selected.data('pixel') + '.png' ).addClass('light-active'); }
Autocomplete jquery inputToken with PHP
Hi, I try to use the plugin "inputToken" but I cannot display the result list returned by the concerned research. You can find the HTML code below : <!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8" /> <meta name="description" content="website"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Website</title> </head> <body> <form action="#" method="post" role="form"> <div> <label for="collaborators">Collaborateurs</label>
ajaxSuccess/ajaxComplete not working
Hi there everybody, as you will guess, I am new to Ajax so would appreciate a little help if possible. I have a JQuery function which sets the width of a div within a table row and then animates the contents to slide up for pagination effect like so: <script type="text/javascript"> $(document).ready (function () { $('.change').each(function () { if ($('.p p', this).height() > $('.time').height() || $('.p p', this).height() == ($('.time').height() * 2)) { $(this).css({
Need to migrate jquery 1.11.1 to jquery 3.4.0
Hi All, Anyone please guide me how to migrate jquery 1.11.1 to jquery 3.4.0 in asp.net vs 2015 application. Many thanks in advance. Thanks & Regards, Nidhi
Warning MutationObserver responsive
using newest version of jquery 3.4.0 shows following warning: "Use of Mutation Events is deprecated. Use MutationObserver instead"
How to insert a (line)break after (each) <h3> element?
Lets start with a sample code: <h3>title line</h3> <figure .....> <img ....>....</img> <div>...</div> </figure> <div>...</div> When I print a webpage into a pdf file then it happens occasionally that the image is visually appended right of the h3 headline. I don't want this. Such an image should ALWAYS be placed immediately BELOW a <h3> headline. So I would like to insert (from a jQuery script) something like a hard line break after each <h3>....</h3> element. How can I achieve this? A <br/> seems
jquery block blockUI cdl ?
block/block is a very useful plugin. is there a cdn available for block/blockUI plugin? or is github used as the cdn? also, is this plugin actively maintained? it appears there has been no activity for a few years.
Get Post Data from Jquery Multidatespicker
This is a very basic question. I don't know how to get the post data from the jquery multidatespicker. When I submit the page I want to echo back the post variables but I don't see how they're sent with jquery.
Next Page