a problem in jquery for select list
here's my html: ---------------------------------------------------------------- <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>M3</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script type="text/javascript"> function listChange(selectObj) { var type = "1"; $("select[name = 'f04']").parent().parent().find("select[name='f05']
how to add select2 , datepicker, timepicker in interactive pages
I have made an index page interactive using php & ajax but select2, datepicker, & timepicker only works on index page but not the content included on that page. Suppose i have 3 page. 1. Index Page - home page to be shown with modal in it and select2, datepicker & timepicker in working only in this page written model. 2. index Content- to be interactive (using ajax) whenever data is added or deleted. 3. modals - modals is being included in index content page but select2,
Select elements inside of a form
I'm trying to select a div inside of a form. Quickly I can select the form using this first console line, left out wrapping elements for simplicity: console.log($(mythis).find('input.img1').next('form')); <input class="img1"> <form method="POST" id="custom_12_img1"> <div class="drop-field"> <img class="preview" src="#" alt="Preview Image"> </div> </form> ... other forms And when I try to select inside of the form, it says 0: $(mythis).find('.ffproedit').find('input.img1').next('form').find('drop-field'));
Run each function multiple times (until condition is meet)
I'm trying to do this: while (getStakeAmount() <= maxAmount){ $('#tabs-' + active + ' .connectedSortable').each(function () { // For each UL $(this).children().each(function () { // For each LI // Do stuff });//End li });//End UL } I'm trying to repeat the each function for all the UL's, as long as condition is not meet, but nothing happens and the browser gets locked. What can be wrong? On the other hand this works, but is only repeated once for each UL. That
Problem Populating Drop-Down on Hover Event
Hi, I am *very* new to JavaScript and jQuery and programming in general. I have a drop-down that gets populated, on a hover event, from a list of jpg files in a directory on the server and adds them to the drop-down list. This works well but the page has to be refreshed when files are deleted or added to the directory, to view them in the drop-down. Someone has very kindly been helping me to try and make this dynamic, so hovering over the drop-down will update the list. But the script does not appear
code.jquery.com unavailable via IPv6
Hello jQuery users, developers, admins, it is 2019 and IPv6-enabled networks are common these days. Even networks without IPv4 (that is, only on IPv6) are starting to emerge. Still, code.jquery.com is IPv4-only, although the StackPath CDN should be able to enable the site with IPv6. For end-users on IPv6-only networks, code.jquery.com is unavailable, which results in broken user experience. What would it take to enable code.jquery.com (and possibly even other *.jquery.com domains) with IPv6? Will
Returning ajax results in the same order they are called
I have some elements I am looping through to get variables for ajax requests, but when I append the data to the page the results are in the order returned by the server not in the order I've requested them. This is my code: $('.playlist').each(function(videoPlaylistUrl) { var playListArtist = ($(videoPlaylistUrl).find('.rageArtist').html()); var playListTrack = ($(videoPlaylistUrl).find('.rageTrack').text()); var lastFmUrl = ( 'https://www.last.fm/music/' + playListArtist + '/_/'
Copy to Clipboard
HI, I've came across a topic where @jakecigar have responded with an answer (https://jsfiddle.net/jakecigar/dbzm58tn/11/). I'm currently using the code he gave but I can't seem to figure out having it to my liking. Here's the code that I've changed so far. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <script> $(document).on('click', '.copy', function(e) { var serialized = $(this.form).serializeArray() var text = serialized.map(function(field)
Show dialog
I have href with id . I want to bring up a dialog box by first performing a series of procedures with the received id and creating my <div></div>. <a class="coupon_link" id = ''$my_test" href="#">Click here to get coupon</a> 1. Need to get id and have id perfom procedures. HOW get id ? PDO ... 3. The resulting PDO procedures result is passed to the my div. <div> <?echo "input type= 'number' class='tests_' id ='name_row' name ='name_row' value = '$my_ result'?> </div> 4. Transfer complited div
Load div in AJAX
Guys, I have page index.php where: $result = '999'; <button class ="btn_y" value="<?=$result?>">EDIT</button> I add AJAX query: <script> $(document).ready (function(){ $('.btn_y').click (function (){ var result= $(this).val(); $('#dialog-edit').dialog({ modal: false, open:function () { $.ajax(function(){ url:"edit_php", data:{ 'result' : result}, type:"post", sucess:function(msg){ $('#dialog-edit').html(msg)
jquery - load latest entry from database without page refresh
Hi, I have a shopping site which has orders table in the db. Orders are shown in admin. May I know how we can load any latest order from the database without refreshing the page? Thanks, Prem
if else
Hello, we have a click event, we need a class to be added after clicking and hover events change. Explain why if I click on event click I set the condition if else the verification does not work for me https://jsfiddle.net/wp2tLnfy/1/ , but the code works only https://jsfiddle.net/wp2tLnfy/
Issue Adding Buttons With jQuery DataTables
Hi - I am using this extension https://datatables.net and I think...I have added all the needed js statements and all the code to add buttons. However, when I render my page the buttons are not there. Can someone take a look at this and tell me what I am missing? [code] <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script> <script type="text/javascript" charset="utf8" script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"</script>
mouse x position over canvas element toggles event
I can't figure out how to get the x coordinates of mouse position over a canvas element to fire en event example $("#div").fadeIn(); a simple example of how I'd like to use this function is if the mouse position is on the left of the canvas it fades a separate div in and then if the mouse is moved to the right side of the canvas element the div fades out. The canvas element is responsive and will resize with the browser I need the event to occur without any click event but rather on mouseOver
Get value inside a string
I can take from within an array a string that refers to a table row that has some columns, and assigned it to a variable. How do I access this variable and get the value of a column cell defined by a class? Example: // Access var $ ws_cell_in and get column value ? $ws_cell_in = $ws_array_row [ $ws_index_in ];
how to do a despedency dropdown with add rows
the data taken from the automatic condition dropdown appears based on the selected activity, such as in the activity selecting the hose then a condition that appears based on activity hose, well the problem is if I want to add the form to fill in the data above. help me: my code: $(document).ready(function() { $('select[name="activity[]"]').on('change', function() { var kode_detail_activity = $(this).val(); if(kode_detail_activity) { $.ajax({ url: '{{ url("penjualan_apar/get_kondisi") }}/'+kode_detail_activity,
Document.Ready seems to contradict my scripts
hi guys I am trying to make my web page friendly, but it appears it seems to be contradicting itself. Here is my code below ( full webpage can be seen here https://www.dropbox.com/s/cgd7tkds5kq73v8/ehi.html?dl=0 ) It seems line 4 and 5 are disallowing lines 26 and 27 As I want to show a loading gif when the users records are being updated, but it fails $(document).ready(function () { $('#Main').show(); $('#Wait').hide(); $('#Add_Submit').on("click",
Problem: Array Dinamic
My goal is to insert data into an html table list according to the number of events on the button, so far so good. The problem is when the event happens for the second time and too many times it duplicates the row getting a total of 3 in the table and if the event happens a third time it prints 3 more times totaling 6? Click to view interaction... $(document).ready(function() { // var $ws_row_zero = 0; // atribui array vazia a uma variavel : $ws_array_row = []; // $(".btn_row_add").click(function()
Is there a way to expand a content inside a div but at the same time the div to move upwards?
Hello everyone, I only have basic html and css knowledge. I am wondering if you can help me with a code? I think it requires jquery and javascript? I saw on this website https://www.autodesk.com/ three black color divs that are expanding but in the same time they are doing a translation movement? What I could get from inspecting the code source is function() { if (parseInt($($(this).find(".wp-expanded-content")).css("height")) > 1) {closeCollection(this); } else { expandCollection(this); }} And there
using Jquery to download a forum page
I notice that when I access a forum full of posts from several years, the forum page downloads in an intelligent way. I can view the most recent posts, but if I keep hitting the PAGE-DOWN key, then the browser sends a message to the server to download more. This is probably done somehow with Ajax. It appears seamless to the user, there is just a small delay and a group of older posts are added to the bottom of the existing page visible in the browser. The main clue that something is happening
Simple form validation error - Returns error . $(...).valid is not a function
hi guys I am trying to get a simple form validation and added my jquery scripts to my asp.net core razor pages. But getting an error what is wrong here <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Personals - Xaxx</title> <link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.css" /> <link href="/lib/xxxx/css/main.css" rel="stylesheet" /> <script src="https://code.jquery.com/jquery-3.2.1.min.js"
Can not call methods
I have a select box with a choice of object. When you select an object, a table appears with a certain set of data. Below the table is the add button, which opens the dialog box. When you first select from the select box, everything is OK, the dialog box opens normally. buttons disappear, title, given window size. I use jquery-ui. I attach the code: <script type="text/javascript"> $(function () { $("#testdlg").dialog({ modal: true, autoOpen: false,
DateTime in a format that I can upload to MS Sql Server
function getSQLDate() { var dt = new Date(); var dtstring = dt.getFullYear() + '-' + pad(dt.getMonth() + 1, 2) + '-' + pad(dt.getDate(), 2); return dtstring; } The above function provides me Date in a format that I can upload to MS Sql Server. But this succeeds only for the date part. If I extend the function (as below) to include "time", the data is not saved. function getSQLDate() { var dt = new Date(); var dtstring = dt.getFullYear()
Cannot get input val() when inside element with css display:none
I am submitting a form with ajax and have a one input field inside div with css display:none for catching spambots but for some reason I can't get the value of the input inside an container with display:none ??? $("#submit_btn").click(function(e) { e.preventDefault(); //get input field values var dummy_field = $('input[name=dummy]').val(); var user_name = $('input[name=name]').val(); var user_email = $('input[name=email]').val(); var user_phone = $('input[name=phone]').val();
Changing hidden field based on select box selection
We have the following: Select field called "favePet" Hidden field called "petRefCode" Because we have no control over the server, we have to do this on the front end. We need to send a certain "petRefCode" based on the favorite pet selection: favePet is Dog, then petRefCode is 'domestic01' favePet is Cat, then petRefCode is 'domestic01' favePet is Hamster, then petRefCode is 'domestic02' favePet is Parrot, then petRefCode is 'domestic02' favePet is Spider, then petRefCode is 'domestic03' favePet
Multiple datepickers on page but require only one to have a vlaue
I have three datepickers on a form which work fine. But I want only one of them to require a date to be selected. When the non-required ones are left blank and the form is submitted they return a default date of 30-11-0001. Is it possible to return a null date (blank)?
math.random returns last function in array
Hi, strictly this is a javascript question, but am posting here because the functions involved use jQuery. I've made a function which is supposed to return a randomly-selected function from an array of five. I've been testing by changing the order in the array, clearing cache, using different browsers, but I'm always getting the last function in the array. "Always" meaning ten iterations of clearing cache and histpry, and trying again. function jun12() {startEm('june12','welcome12')} function jul01()
Autocomplete not working in iframe only in IE 11 - works in Chrome
I am working on an old MVC application that is having problems displaying an @Html.DropDownListFor that has 15,000 rows in IE 11. I replaced the DopDownList with the jQuery autocomplete and it works great in the application. The problem is that the application is also displayed in another web page in the organization in an iframe. The old DropDownList worked fine in the iframe, but since I replaced it with the autocomplete, it wont work. When text is typed in the autocomplete, nothing happens. I
$ Variable in this code
http://jsfiddle.net/TLdp9/6/ In this code, line 4. What's the $ about? When I run the code I get this error "Uncaught ReferenceError: $ is not defined"
Help with a simple lookup page
I am new to this type of coding after nearly 10 years of Autohotkey, and have tasked myself with an online Karaoke book lookup, that will work on a phone, I have the basics working fine, but have a question or two, 1. Can a csv file be searched, without being loaded into a table first, just display any search hits in a table? (the file i am searching is book.txt) and my delimiter is ^ 2. I am using a load Songlist button to force DB refresh whenever i load the page, Does this make sense? Working
Image not open at bigger size on mouse hover
Hi, I placed one small image on right bottom of my website. Once user mouse hover the image it opens or expand the image as original size in same place.It should hide the small image and shows the bigger image(original image) on that place. My code worked for placing small code initially. after hover the image, the bigger image not opened properly. have some issues. Kindly help this for solving this issue using javascript or jquery or CSS. <div class="bcFloat" style="display: block; left: 933.12px;
Problem in selecting li
<ul> <li><a href="#">Books</a> <ul> <li><a href="#">New Books</a></li> <li><a href="#">Old Books (2017)</a></li> </ul> </li> </ul> When I am trying to access 'Books' . Jquery is also giving me 'New Books' and 'Old Books (2017)' js code is.. var li = $("ul :last-child").find('a').text(); alert(li); Please help...
Map and Autocomplete only work after refresh
Hi, I just started using jQuermobile and I ran into a problem. My project consist of four pages, all loaded into the index.php via GET... https://fuel.vietze.org/ The first page inclues a OpenLayers Map, which doesn't work initially, when the page is loaded. Only after I refresh the browser once, it loads and displays perfectly. A similar effect prevails with an autocomplete form that is included in the top of every page. Upon initial page loading, you can type in the field, but autocomplete won't
jquery writes a double-click to a variable
I have such a problem, I have a code, and in this whole program the idea is for him to perform some action under the condition of what will happen in the result variable and he performs this action but I will double on this button. Code js function edit_drugs (url, idDrugs, i, url2, url3) { $ ("# EditDrugs" + i) .load (url + "? IdDrugs =" + idDrugs); $ ("# updateDrugs" + i) .html ("<input type = 'button' class = 'btn btn-success' onclick = update_drugs ('" + url2 + "'," + idDrugs
Sending picture & data to DB
Hello, Little difficulte to explain my problem... Ok I have a form with inputs and image upload. I have two object JSON One with the image converted to Base64 then converted to JSON string One with all the other inputs. Now I want to send it to my controller and DB. But I totally don't succeed. This is a github link to check the HTML and controllers also a screenshot of DB diagram The main problem is when I want to send the picture I need the RecipeID (int AddRecipe) but how can I get it to add it
command keeps repeating n Number of times
Hi, I am new to this forum and Jquery. I need help with this code I have two tables table1 on the left and SelStudent on the right. table1 has checkbox on each row which when clicked fires the function below. My problem is when I click a checkbox on any row in table1, 1 record is appended to SelStudent Table $("#SelStudent").append(ttext); runs once, as expected) when I click another checkbox in any row of table1, 2 records are appended to SelStudent table $("#SelStudent").append(ttext);
Counting the selectedCell class
I'm trying to count the number of selected cells with class="selectedCell" for each row in the following code. $(function(){ var output = $('table').find('td.selectedCell').length + ' selected cells'; $(".tdoutput").html(output); }); I have a working example here, but the count shows the same for each row, and instead it shows the total count for the table. http://jsfiddle.net/tbeup691/
Slideshow with thumbnail grid and support for images and youtube video
Can anyone recommend a slideshow plugin that supports both images and embedded youtube videos. I need something that will look like the below mockup when you click on a thumbnail the image or video is loaded in the larger preview window. The images that would be used are variable sizes so ideally think it would need to use a container possibly utltising CSS background-size:cover to get a decent coverage of each thumbnail whilst keeping everything uniform in the thumbnails grid.
Changing db data with representative values with jquery
I have a simple table. <table class="tb"> <tr><th>ColA</th><th>ColB</th><th>ColC</th></tr> <tr><td>10</td><td>12,3</td><td>24,5</td></tr> <tr><td>40,4</td><td> </td><td>5,5</td></tr> </table> I would like to change the original mysql data with representative values that I assign to them. So if there is a value in the first column, then they are all replaced with 1, if there is a value in column 2, then it is replaced with 2, if not, it is left blank, and it goes on like this. Would it be possible
jQuery find function with escape characters not working in latest version
I have a selector in a find function that works with jQuery 3.3.1 and before that doesn't in 3.4.0 and 3.4.1. I am using it on an xhtml jQuery document object that I have used $.parseXML on. I am using the full version of jQuery. I have looked into the jQuery changelogs and see nothing that should affect this, as well as in the source changes on github. I have tested the find with .class and #id and it works, but the IDs will be dynamic so I need to search by attribute name. There will also be multiple
Next Page