Trouble with a jQuery blur form event
Here's the page in question: https://pr-infrared.com/product/trijicon-reap-ir-mini-thermal-riflescope/ See how it says "Starts at $6,999.00"? Next choose any of the options from the dropdown menu. Notice how the price doesn't change? Now click anywhere outside of the select dropdown box and watch the price update to what it should be. That's not how it should be. What should happen is the price should update as soon as you select a new option from the dropdown menu. In other words, you shouldn't
Table Rows Toggle
I have a table with multiple rows (<tr>). I have 3 types of rows. Two being headers identified by class Year and Month. The 3rd type is just data. Essentially it's like a TreeView but stored in a table. When a user clicks on a Year I want to toggle all other years and just show this one. Same with months but inside that year only. Any ideas?
Adding new content to webpage, but new content does not interract with jQuery
Hi Everyone I am realtively new in jQuery and I would like to ask you for help. I'am doing my school project and there is one thing I do not understand when I added new content by jQuery to the website it does not work (new content) for a clickable option. The old content that is on the website do work properly, but new would not. I attach jsfiddle link. https://jsfiddle.net/ujy8sLpf/2/
Specialinput jQuery Plugin
I am using a jQuery plugin (https://www.codehim.com/text-input/insert-special-characters-in-textbox-jquery/) to have an additional keyboard next to an input area as you see on the image. (It is deployed in h5p plugin, a quiz plugin) This way, by clicking this additional keyboard, one can type in special characters in French, Turkish etc. Here you can see what I'm talking about: https://fluentinturkish.com/dir/example-jquery The problem is when there are two input areas. if I click on the second
Internet explorer refuse to run jquery-3.3.1.slim.min.js
Other browsers have no issues running the html/javacsript page. But, internet explorer refuses to run the java script, and it is giving a message "Unable to get property 'createElement' of undefined or null reference. (2,7189).
Is it possible to combine two different element types, handling the same function?
Hello, I have an element type Input and an Select like: <input type= "text" class="filter_field" id=filter_anam" name="filter_anam" value="filter op achternaam"> <select class="filter_field form-control" id=filter_catg" name="filter_catg"> I have created for each a jQuery function which is working: jQuery('.filter_field').keyup(function(){ filter_data(); }); And jQuery('select[name=filter_catg]').change(function() { filter_data()
How to advance to the next slides when a video ends?
I'm working on something to be used on TV broadcast where it shows the camera, a menu and bottom line at the bottom of the screen. Everything works great until I have a video to be played and I need to advance to the next slide. When the video ends, it plays it again and the right menu advances to the last item and scrolls until it can no longer scroll. Also the bottom part advances again when the second video ends. Here's what I'm talking about if that didn't make sense: https://codepen.io/openbayou/pen/dyYvYRN
AJAX Not running
I have a main.js file attached to my index.php page. I load my contend via AJAX into my index.php page. I load a page via ajax which works. On this loaded page I want to call another AJAX script. It get Started and End in my console log but AJAX does not work Why? $("body").on('click', "#acceptQuote", function(e){ console.log('Start'); e.preventDefault(); var q = $("#quantity2").val(); var i = $("#ID").val(); var p = $("#offeredPrice").val(); $.ajax({ url: 'scripts/acceptquote.php',
Validation Not Working For Multiple Fields in a Form
I have a simple test form with three fields. Two required, one not required, and one minimum length. I am using jquery validation unobtrusive with Bootstrap 4. The first field validates fine but the last field in the form is not validated at all and I am able to reach the submit handler with an invalid form. Please help. https://jsfiddle.net/ddelella/mL4a0hbv/3/
Uncaught Error: Syntax error, unrecognized expression: #
Hello everyone, I'm using jQuery v3.3.1 and I have a drad and drop function that is giving some users an error which i can't replicate. The html: <div id="target-2" class="dndS-target target-2" ondrop="dndSimpleDropTarget(event);" ondragover="dndSimpleAllowDrop(event);" data-id="2"></div>The Javascript in question (until the line where the error is called): function dndSimpleDropTarget(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); var here = parseIfInteger($('#' + data).data('id'));
append is nesting divs when it shouldn't
When I do something like $(".something").append($('<div class="aaa" /><div class="bbb" />')) the bbb div gets rendered inside the aaa div instead of them being siblings. Am I doing something wrong? It used to work but we've just upgraded to use the latest version of JQuery and it's stopped working.
is there any funtion exists in javascript like c# function datatime.specifykind
DateTime.SpecifyKind(Convert.ToDateTime(filterParam.dtFrom).Date, DateTimeKind.Utc); well the main question is. i get datetime in json string "2019-01-01T00:00:000Z" i do not want to remove Z out of it and i want to show it on page with ddMMyyyy formate, when i use moment(day).format(timeFormat);. this reduces my date by one as my local is America. so please suggest how should I format.
totally bizarre problem
hello - i am having trouble getting a jQuery jqwidget app working for one specific customer. its as if the underlying jQuery is being blocked somehow. This simple example is only using a jQuery drop-down combo-window. we tested it on Edge, Firefox, and Chrome on two separate computers. and right-click on the element does not show any console errors. it behaves as if either the router or cox-cable at this particular location is somehow "blocking" the left-click to work! my next guess is to have
multiple datapickers
I have a questionnaire that collects birth dates of several people. How can I make these datefields working with one function to instantiate them all? I tried to use a class selector, but then only the first date field is accepting input
textarea using jQuery.UI Resizable parent Div cutting off lower half of the textarea
I'm adding text to a textarea that has been modified using the jQuery.UI resizable plug-in, after which I resize the textarea's hight by setting it to the textarea's scrollHeight, but since the parent div, added by the resizable plug-in has a fixed size, the textarea gets cut-off when the textarea height is now taller than the parent div's height. I tried to fix this by assigning 'auto' to the div's height, but something is preventing my assignment. I also tried 'auto !imporant', but this didn't
Using selectors to find children <th>
My goal is to find those tags with a class of .ht_nestingParent and then add a blank table row above the .ht_nestingParent and then a blank row under the last of it's children rows; which are the rows below that lack the .ht_nestingParent class. Here is my HTML <tbody> <tr> <th class="ht_nestingLevels ht_nestingParent"><div class="relative"><span class="rowHeader">1</span> <div class="ht_nestingButton ht_nestingCollapse"></div> </div></th> <td class="">7-ELEVEN</td> <td class="">22971161</td>
another Math.random() problem
I'm using a Math.random() function which determines the length of a delay: function dl() { var pause = [1600, 1600, 2400, 2000] dlay = Math.floor(Math.random() * pause.length); return pause[dlay]; } which works fine. Then I want to use another function with different delay possibilities: function newdl() { var paws = [400, 400, 300, 200] dly = Math.floor(Math.random() * paws.length); return paws[dly]; } --but this newdl() returns values from dl() ! I've
jquery not firing after form submit with ajax
Hi, The code below works GREAT on form page load and typing into "test_field". The number of characters left display correctly in "display_char_left" So all is good until AFTER the form is submitted. After saving the form, ajax is used to refresh page (save data) and display form again with the same field data. Now, the countChar() is never fired again. How do you make the countChar function continue to execute/work AFTER saving the form, when ajax is used to refresh the page? thanks <script>
How to block weekend from selection on altField
I have 2 fields: DeliveryDate and PickUpDate DeliveryOffDate can be any date except Sundays or Public holidays: Sorted PickUpDate is configured to default to DeliveryDate + 7 days Problem: Delivery can be a Saturday BUT Pickup Cannot. So, If a DeliveryDate is "Saturday", I want PickUpDate = DeliveryDate + 9 days (Monday) function nationalDays(date) { for (i = 0; i < natDays.length; i++) { if (date.getMonth() == natDays[i][0] - 1 && date.getDate() == natDays[i][1]) { return [false, natDays[i][2] +
jqTree: Does anyone know how to make a category node editable?
jqTree looks great. However, one thing I would like is that the category name could be editable like in a windows category tree. Here is the jqTree url: jqTree Many thanks !!
JQuery change background not working
Dear Sir/Madam please refer http://ca-4-india.online/membersearch.php We are listing Activity (Each activity has 2 options Yes , No) viz Income Tax has 2 options Yes or No GST has 2 options Yes or No ------------------------------------------------------------------------------------ when clicked on Option No We want to change 1. for item clicked we want to (NO is clicked) color of the text to white background color to #9C1041 2. For Option Yes (currently green background and
append data jquery
Hi I'm work in reply to a comment my problem how to append text in ckeditor
$.when it doesn't work.
Hello: I have the following code: function LoadTiposIva() { if (TiposIva.length == 0) { //ajax function for fetch data $.ajax({ type: "GET", url: '/FacturasENet/GetTiposIva', success: function (data) { TiposIva = data; console.log("1", TiposIva) } }) } } function resto() { renderTipoIva($('#TipoIvaId'));
Getting selected value
How do I get the selection option using jquery from a table where the last celle contains something like <td> <form action="" method="post"> <select name="moderation"> <option>offline</option> <option selected="selected">online</option> </select> <label>Delete: <input type="checkbox" name="delete" value="delete"></label> <input type="submit" value="update review"/><br /> </form> </td> I need something like $(".data tr td form").each(function(){
Pass variable from get into ajax
I'm trying to check if a file exists and if it does set a variable (furl) to a string and if it doesn't to another string. Furl isn't being found after the get runs. How do I get the furl value into the ajax ? var curprotocol = window.location.protocol + '//'; var curhostnm = window.location.hostname; var curpath = window.location.pathname; var curlseturl = curprotocol + curhostnm + curpath + 'includes/setsacookie.php'; console.log('CurSetUrl: ' + curlseturl); $.get(curlseturl) .done(function()
Escaping Data
What is the best way to escape data? I have values which will be coming out of a database and need the ' & " to stay intact. I've tried replacing them with HTML values etc but they don't render right... <script type="text/javascript"> const data = [ ['AM STD 3x6 ID BLUE BKGD FACE||DWG AS090292||', '1', 'A', '22990461', '2020-04-06', '2020-03-11', '5', '', '0000-00-00', '0000-00-00', '0'], ['AMOCO 1'9x4'4 TOGO SF CTS SGN(NO LEAF)||DWG BP1024SF_LDSV||FACE:
JSON.stringify two objects.
Hi, I have two array objects: pupil = new Array(5); for(n=0; n<=5; n++){ pupil[n] = new Object(); pupil[n].name = "Pupil "+n; pupil[n].age = 20+n; } The second object is as follows; subjects = new Array(3); for(n=0; n<=2; n++){ subjects[n] = new Object(); subjects[n].book = "English"; subjects[n].isbn = 1230 } I plan to write this to a file. I can do this with one object array and it works fine but is it possible to write both with something like this? details
Create multidimensional array based on recursive HTML-form
Hi, I am working on an application with some workout exercise. For this I am building a HTML-form which is repeated several times as there are different exercises which needs to be entered. I want to transfer the input into a multidimensional array I can work in PHP before inserting into a database. I found a way through serialize(), but it lists all input out as individual arrays. I can manage this data and set up a function to sort them later in PHP, but I believe there is a better way to structure
Showing value of .serialize
Well I thought I had it made yesterday when JAKE posted his answer to my post "Get values from inputs which are array elements" However I can't get the serialized data to display anywhere. My form has the id="AcctForm". None of the alert(), console.log() or document.write() show anything. In Firefox web tools, under console, the Params show the array of inputs. The Response column shows the script code. Under Network the Params show the array of inputs and Response shows the script code. Under Request
[Beginner] - Identify selected form and return hidden input-field value
Hi, I am completly new at jQuery (and javascript in general) and find my self struggling with this: The amount of forms will vary from 0-50+ and is automatically generated through PHP. The forms are pretty much identical, except from they all have a hidden input field which contains a workout id. Once the user hits submit, I want to call a php-function which retrieves all the data from the database and portrays the data in a table in a table/Div-overlay on top of the page. I can do the HTML and PHP
Focus Blur problem
I need to change background color depending on the visibility of dropdown list. Can anyone help? It won't turn to red when I click outside of the menu. https://jsfiddle.net/s86krz1e/ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).on('click','body', function(){ if(jQuery(".selector").is(":focus")){ $("body").css("background-color","green"); } else{ $("body").css("background-color","red");
Get values from inputs which are array elements
I'm trying to get values from the form1 inputs in order to make an AJAX call. The $_POST global array is undefined and I'm stuck. Thanks in advance for your help. Note: <input type="text" name="AcctFor[]" R <script type="text/javascript" > // ============================================== // produce array of values to send to PHP script for processing database data. $(document).ready(function(){ $("#form1").submit(function(e){ //e.preventDefault(); // get same undefined $_POST error if
Tablesorter: hide certain filter boxes when on mobile phones
Hi folks, I'm using jQuery's Tablesorter v-2.31.3. So essentially, I have a large table that doesn't quite fit nicely on mobile devices (too much columns of data). I've decided to hide columns using a CSS class I created "hideme" : <style> /* CSS Specific for phones, tablets, etc. */ @media only screen and (max-width: 767.98px){ .hidemeOnPhones { display: none; } } </style> I've added class="hidemeOnPhones" to all of my table's TD's and TH's I don't want showing up when viewing the page
problem with a switch function
Hi all: I have a function which returns randomly either 6, 7 8 or 9. Then there's a switch function which does different things for each number. Problem is, connecting the random results to the switch function. Currently, Firefox is saying "unreachable code after return statement", but I don't understand how FF's problem with "code after a return statement" applies. Here's the code: function fastLine1() { var poss = [7,7,7,8,8,8,6,9] result = Math.floor(Math.random() * poss.length); return poss[result];
jQuery if statement problem
Hi everyone I am working on my smart home project for college. I am using jQuery to change value of the buttons however it doesn't work as desired Whenever to floors are shown I would like to change the 3rd value (both floors) as well Included code $(document).ready(function() { $("#groundfloor").click(function() { // changing attributes of the buttons if ($(this).text() == "Show ground floor") { $(this).text("Hide ground floor"); } else if ($(this).text()
Add plugin to dynamically created inputs
Hello: I am using the plugin fn.numeric(). This plugin works correctly. I dinamically create inputs. But it does not work. What do i have to do to make the plugin work on the dynamically created inputs? Thanks...
How to get the src attribute of all images on a page with jQuery
I am trying to get and use the src attributes of all the images on a page.However, my code returns only 1 src attribute of the images except when run inside the each function. Any ideas of what I am not getting right? jQuery(".clicker").click(function() { var imgWalt = ""; jQuery.each(jQuery("img"), function() { imgWalt = "<img src='" + jQuery(this).attr("src") + "' />"; }); alert(imgWalt); }); See the working code on jsFiddle
How to Detect When Draggable Hits Top or Bottom of Containment in jQuery UI
Can you please take a look at this demo and let me know how to detect when .draggable hits top and bottom of it's containment? $(function(){ var draggableRight; var draggableWidth = $('.draggable').height(); var parentWidth = $('#parent').height(); $('.draggable').draggable({ containment: 'parent', axis: "y", drag: function(e, ui){ // ==> if .draggable hits top of parent change it's background red // $(document).trigger("mouseup"); // $('.draggable').css({ background: 'red' }); // ==> if .draggable
Help with validation with "jquery validate"
Hello friends. I am denying with the validation with jquery validate to know if a user exists in the database at login. I am getting an "undefined" error, I don't know if the error will be in the json handling. I hope you can help me. This is the working link: https://pruebaswebcordoba.000webhostapp.com. For example, in the database there is an email called "usernamecordoba@gmail.com" and the idea is that it says on the screen that it exists if you type. html: <form method="post" name="myemailform"
Assigning and updating value for dynamically created input tags - jquery
I am trying to build a invoice, I am getting the values from the database to populate the Materialize dropdown and onAutocomplete to trigger the next events If user enters the Product code the value is being passed through ajax request and assigned to the corresponding values. For single row the code works perfect, Issue is when I add a new row and update the changes to any of the field. Issue I am facing: Values in all the rows are updated regardless of what's being clicked. I am not sure how
Next Page