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
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
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
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
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
JQuery - Clone View [object Object]
I am using clone to copy an input and when viewing it on the page I get [object Object]. I clone it as follows: var clonado =$('#Descripcion').clone(); And I visualize it as follows: var nuevaFila = "<tr>"; var clonado =$('#Descripcion').clone(); nuevaFila += "<td>" + clonado + "</td>"; $("#orderdetailsItems").append(nuevaFila); And displaying it comes out [object Object] instead of cloned input. I have tried to put cloned.html () and I no longer get [object Object], but I get empty. To prove that
when refresh radio button or go next radio button unchecked
i create a quiz system, in my quiz system when i checked radio button then it checked and data stored in database, but problem is that after i go to next or prev button previous checked not display. please help me i use Ajay pdo
I got this error while creating custom JS file please help me, Uncaught ReferenceError: JQuery is not defined at main.js:2 (anonymous) @ main.js:2
//Custom Js fo slider JQuery(document).ready(function(){ "use strict"; $('#slider-carosel').carofredcel({ responsive:true, width:'100%', cirular:true, scroll:{ items:1, duration:500, pauseOnHover:true }, auto:true, items:{ visible:{ min:1, max:1 }, height:"variable" }, pagination:{ container:".sliderpager",
jQuery stuff I haven't seen before; jQuery(this) and ;(function($) { ... })(jQuery)
I'm working with a jQuery plugin, and it has some unusual coding that I think might be kinda old school. For the sake of my own education, I'm hoping you guys and gals can give me some clarification. First, I see this: var $elem = jQuery(this); I've never seen jQuery(this)... is it the same as $(this)? I did some tests and they appear to be the same, but later in the script the author uses $(this)... so why did he use jQuery(this) in one part and $(this) later? And is there a reason he used $elem
Question about required checkbox
What do I have wrong here? I'm trying to create two scenarios. One checkbox will always be displayed no matter what's included in the URL string. If that's the only checkbox that's visible on the page, it must be checked before submitting the form. However, If 'ref' is present in the URL string (foo.com?ref=201), a second checkbox will appear and one of the two checkboxes needs to be checked. The problem is that when 'ref' is not present in the URL, it's still in the form with 'checked', so the
Checking URL for one of three values
What's the best way to write an if statement to check if test is either equal to 200, 300 or 400? if (window.location.href.indexOf('?test=') = 200) if (window.location.href.indexOf('?test=') = 300) if (window.location.href.indexOf('?test=') = 400)
how i can get total price column sum in tfoot sub total amont?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>How to add or remove rows in a table dynamically jQuery </title> <link href="css/bootstrap-4.0.0.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> /*find varial in textbox*/ function myFunction(){ var test_code = $('#tests').find(':selected').data('testcode');
Animated counter
Greetings, How to make a jQuery script that show dots rather than commas in an animated counter? I created this scholarship graphic using the code below. However, I want to make sure that the numbers display dots only. Any good ideas on decimal separation here? <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> const formatter = (Intl !== undefined)? new Intl.NumberFormat().format : (t) => t; var a = 0; $(window).scroll(function() { var oTop = $('#counter').offset().top
jQuery CRUD Table Modification
Greetings from Retirement-land! Once again, I call upon those with greater expertise in jQuery/AJAX/Javascript for enlightenment. I'm learning, but "the road is long, with many a winding turn". I have a jQuery CRUD table that I found online that our disc golf indoor putting league is using to keep track of weekly scores. Here's a screenshot: https://lists.roe3.org/mdrone/EDGE/PLIM.png The [Add Player] button adds a row at the bottom with all "text" input fields at the bottom. Editing is click the
Jquery Keyboard Trap
I am trying to implement a modal dialog keyboard trap and can't seem to figure out why it isn't working as expected. I have included a jsfiddle below showing the code. In theory if a user is tabbing through the buttons using a keyboard once it reaches that last button it should jump to the first button. If a user is using shift and tabbing it should jump to the last button when the first button is reached. As you can see it actually skips the intended button in which I am directing focus. I would
Duplicate error message printing if user click button multiple times
i am trying to validate user form input field using jQuery. it is validating correctly but error message showing multiple times if i clicked submit button multiple times. it has to clear previous message before printing new one. My JQuery Code is: $(document).ready(function(){ $('#createUserForm').unbind('submit').bind('submit', function(){ var username = $("#userName").val(); if(username == ""){ $("#userName").after('<p class="text-danger">Username required ?</p>');
Updating jquery version from 1.7 to 3.4.1.
Updating jquery version from 1.7 to 3.4.1. While running the application in chrome browser getting below error. TypeError: 'undefined' is not a function (evaluating 'e.getAttribute("type")') /js/jquery.js:2 in Pe /jquery.js:2 /jquery.js:2 in Ie CURRENT VERSION :Jquery-3.4.1.js
i have got two dates , i have to generate all dates in between them and store them in an array.(jquery 1.12.1) vs2019
hi, var arr =[{"date":"10/dec2019"},{"date": "11/dec/2019"}] // and so on between 10 dec 2010 to 10 dec 2020 above thing can be done using lemda , but pls do not use it as it is not working in my environment , it is working in fiddel. so pls solve with out lembda.
Slider not dragging on Mobile
https://dev8.onlineinfluxdev.co.uk/ Is the site. The slider on the Homepage works perfectly on a Desk Top but not on a Mobile. Touch works but it won't drag and I can't see why. I presume something is missing but I don't know what it is. Thanks
JQUERY on Mobile
Is it possible to view JQUERY error messages or JavaScript error messages on a Mobile? I have a slider that works on a Desktop but not on a Mobile and I would like to see if there are any JQuery errors? If it is possible how? Thanks
only copy selected items to clip board
My form as a checkbox next to each line, this checkbox will exclude those items from copying to the clipboard. Is there a way using JQuery to exclude items from copying to the clipboard, but keep the remaining non checked items? if they select, State, Price and Agency, then they should not be copied to the clipboard, but Manager and Name should be. <div id="Sales"> <div class="sale"> <input type="checkbox" id="salesId_1" value="state"/><label for="State">State/label> <input type="checkbox"
how to populate update form with multiple select on jquery laravel
i want to show when update data in multiple select via jquery to laravel my Controller $get_user->region = $region; $get_user->nama_customer = customer_name($get_user->kode_customer); $ispector = array(); $get_inspector = DB::table('tabel_inspector') ->where('kode_user',$id) ->first(); if(isset($get_inspector)){ $all = explode(',',$get_inspector->list_customer); foreach($all as $a){ $inspector[] = $a; } $get_user->list_inspector = $inspector; } return response()->json($get_user); My Jquery, in jquery
Access an external website and trigger a button click
Is it possible to use JQuery and access an external website and trigger a button click on that site? For example on this site there is the button "Click me!": https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_test Would it be possible to access that site and click the button? And if so, how would that be done?
Expand/Collapse SharePoint all Webparts on a Page
Hello. This jQuery adds expand/collapse functionality to a single SharePoint Webpart by adding a + or - sign next to the webpart title. It works great with SharePoint Online for a specified webpart (ie WebPartWPQ4). How can I modify this to add the + and - to all the webparts on a page? /* Expand-Collapse*/ jQuery(document).ready(function() { jQuery("#WebPartWPQ4").hide(); //Add Expand Icon to Web Part Header $('Span#WebPartTitleWPQ4').find('h2').append("<span style='padding-left:0.5em;
How to make function give row that have different value with color red to full row ?
problem How to give red color for rows on html table that have different values on same row ? I need when at least one cell from row different from each others then give red font to full row if you see below row that have same value on all cell not changed color . I need function give red color for row that have at least one value different from others on same row so How to make function do that by jquery or java script do red color for row if it have at least different cell value . rows have different
Chaining dynamic Select/Option boxes together
Hi, I have a directory with several databases each containing multiple tables. I am trying to create a program where Select/Options boxes are utilized to 1. Pick one database from several options. 2. Pick one table from several options produced from the selection in 1. and 3. Send the final database and table to the Server via AJAX in order to query the database. To implement 1. I use PHP to select databases from a directory. I dynamically create a form containing the first Select/Options box. This
how so that when searching for the check remains and is not lost
I want when I search, the check isn't lost, and it's still there, but right now I can't find a way out, how do I check it while still searching or filtering data? please, help me! my jquery fetch_customer_data(); function fetch_customer_data(query = ''){ customer = []; $.ajax({ url : '{{ url("user/search_customer_2") }}', method : 'GET', data : {query : query}, dataType : 'json', success: function(data){ $('#message').html(data.search_customer); } }); } $(document).on('keyup','#search', function()
Need to check internet connection
I've been looking around for jquery code (and I've been looking at pure javascript code as well) that will test my internet connection. I googled and found many posts are old, going back to 2012. I've tried about 3 or 4 'solutions' but I can never get a failure when I disconnect my wifi at home! How odd eh? The messages always say connected. Is there any reliable jquery code that will work? Thank you...
Issue of logic with jquery validator ?
Hi, everyone I wish someone could help me with a little problem or I'm stuck. My problem is that I'm trying to prevent any additional lines from being added as long as the number is less than or equal to the stock number. I use jquery validator to perform this verification in real time. This is my Jsfiddle : JSfiddle Thanks for the help This is my Jquery code : jQuery(function($) { $.validator.addMethod("stock", function(value, element) { const stockReel = parseInt($(element).parent().prev().text())
removeProp("max") from date field not working
I've been trying to remove a 'max' property from a date field when I load a form but it doesn't work in jQuery 3.3.1 or 3.4.1. However, removeAttr("max") does work. Is there a reason for this? I'm using Firefox 72.0.2
Calling jquery function from asp.net OnClientClick
what do I put inside the asp button's OnClientClick to call my jquery function? Also,I still want my button handler in asp.net to function $('#btnNewBlock').click(function () { $('#pnlBuildBlockInsert').show() }); <asp:Button ID="btnNewBlock" runat="server" Text="New Block" Visible="true" OnClientClick="????" />
Combining Span Element Values
You'll discover quickly that I'm a jQuery/Javascript novice who harvests code snippets from the web and tries to get them to solve little problems as I encounter them. I'm working on a little PHP web app that takes a list of disc golfers and randomly assigns them into foursomes (and threesomes when there's a number that's not divisible by 4). Source code is on GitHub. I'm trying to get it to count the number of checkboxes that are checked (that's working OK except when the hyperlink is clicked to
Delete specific buttons in a list view
I have a list view that has grouping rows that I created dynamically The first row in the list view is a grouping row. I can recognize a grouping row from <td colspan="6">Block Title: LastTime Chatted</td> It will always contain 'Block Title' After a Group row there will be a variable number of rows that have buttons in the first column <input type="submit" name="BlocksGroupedByBlockName$ctrl4$btnAddContent" value="Add Text" id="BlocksGroupedByBlockName_btnAddContent_4"> The value will always be
Search a text and highlight
I am trying to Search a text and highlight it inside an HTML element. But it is not working properly. Just first character of searched text is highlighted. $(".modal_search").on("keyup", function () { var Id = $(this).attr('id'); var searchItem = $(this).val(); $('#textModal_'+Id).find(".highlight").removeClass("highlight"); var searchText = $('#textModal_'+Id).html(); var reg = new RegExp(searchItem, 'gi'); var txt = searchText.replace(reg, function(str) { return "<span class='highlight'>" + str
Animated canvas
Hello i have a problem with a code in jquery. I need to make a Animation with a cowboy in canvas ( draw cowboy with curcle and line) then cowboy shot a bullet and when a bullet hit a wall,turning back and hit the cowboy. Then cowboy falling down and a message apears "that was a mistake" I have wright the code but i cant make the cowboy falling down and display the message. Ps: Attached the code here if anyone can help me. Thx :)
Issue with ready() method using jQuery 2.2.4 and Chrome 79
Having an issue using ready() method with 2.2.4 and Chrome 79 (worked w/ Chrome 78). A change was made to restore form control state on finishing document parsing in Chrome. Issue 1035662: Chrome 79 not reflecting DOM state in onpageshow after back navigation If you use the example below, it gives a zero value when using 2.2.4 (but it works using 3.4.1). Is it possible to patch 2.2.4 to get the same functionality as 3.4.1 or is that no longer worked on? Select items in the dropdown and then navigate
How to make sure the DOM is fully loaded and there are no more pending changes?
Hi everyone, please excuse me if this is not the correct forum to post this question but I've exhausted all other venues of information. I am working in automating some test for a webpage that is highly dynamic and using jQuery heavily. Almost all the elements in the page will dynamically load or swap elements of the DOM when clicking or inputing text and I am having a really hard time waiting for the elements to be on it's final state before interacting with them. So my question is, is there a surefire
jQuery selector img[alt="projects4"] doesn't always work
Here is my client's site: https://kteva.co.il/ I try ti target the images in the carousel bellow the slider(with 10 images) Problem is that some work while others don't Her is a typical snippet that I use: $('img[alt="projects4"]').on('click',function(){ jQuery('#extra-text').modal({ fadeDuration: 1000, fadeDelay: 0.50 }); }); Any idea? Thx
Next Page