Change Order of Buttons
I want the rotate buttons to be on top of the submit button but when I put the rotate buttons on top and then click to rotate the form submits prematurely. Here is my plunker: http://plnkr.co/edit/C8m9fPgZmzc49snWL1cL?p=preview
jquery append behavior documentation
I'm modifying a Google Apps Script Web App within which I use jQuery, and it generally works fine. Anyway, the code includes this structure, which I continue to use, and works particularly well: $('#searchId').append( $('<h4/>') .attr("id", idVar) .addClass("whatever I want") .text(textVar) I can't figure out what this approach is called, in order to learn it better: when I look up append documentation, I don't find examples of this (specifically, I'm talking about the
Populate one dropdown list based on the selection of other dropdown list using json
Hi, I would like to the same thing as http://jsfiddle.net/kasperfish/r7MN9/3/ using json instead of arrays. With second select menu like this <select id="item"> <option value="1">Mercedes</option> <option value="2">Volvo</option> <option value="3">BMW</option> <option value="4">porche</option> </select>OR <select id="item"> <option value="1">Samsung</option> <option value="2">Nokia</option> <option value="3">Iphone</option> </select> Could anyone help me with that please?
Issue with testimonials slider
Hi, I have a testimonials carousel at the bottom of my home page that slides in and out of the page - two slides at a time. What I would like to fix with it is when the first two slides are sliding out they disappear too soon, I would like them to not disappear like that and instead just slide out without incident. I've been unable to figure out what the issue is. My site: http://10meijin.com/ <div class="container"> <div class="row"> <div
parse textarea characters
Hi. Please check this site: http://jsfiddle.net/jsfiddleotc/eJzfw/212/ I would like to take the text in textarea and place it into textarea2 upon form submit. But I would like to limit the characters per EACH line to 20 characters into textarea2. I would like to do this where a word however does not split or be cutoff at the end of a line and be continued onto the next line. So for example: Let's say textarea was the quick brown fox jumped over the fence Upon form submit textarea2 would show the
what are the most efficient ways to return a value from a loop?
down votefavorite What are the most efficient ways to return a value from a loop? FlowId in the following example represents a concatenation of region names followed by "Flow". For example, "NortheastSoutheastFlow", "TexasSoutheastFlow", etc. regionNames represents an array of region names stored as a global variable like ['Northeast','Southeast','Texas']. The regionName function param represents a known region name and the goal of the function is return the other region name included in the flow:
Issue with animated slider
My animated slider on my home page is not functioning properly for some reason. I've been trying to figure out how to fix this to no avail. Can someone please help me out. Thanks in advance. My site: http://10meijin.com/ <!-- header slider --> <div class="header_slider"> <div class="banner-container"> <div class="banner"> <ul> <li data-transition="fade" data-slotamount="10" data-masterspeed="300">
serialize array
I have an array like as follows: var a = [ ["val1", "val2", "val3"], ["val4", "val5", "val6", ["val9", "val8", "val7"] ]; I want to serialize it so that I can set it as a value of a text box as follows: <input id="input-id" type="text" name="serialization_stack" value=""/> serialized_a = serialize_array(a); $('#input-id').val(serialized_a); Can someone help me to define the function serialize_array()? Thx
Ajax calls and rework
Hi every one, thanks for your time :) I've started using a framework which consists of a JQuery front end and ASPX web methods(JSON), so far I'm really enjoying it but it is becoming painful for agile projects. My biggest issue is pretty much reworking the success responses each time and it can get messy, for example: On window open: Get person info Get company info Validate permissions Show the window once all 3 are complete. Now my boss comes back to me and he wants to add 2 more conditions before
replacement of toggle function code
toggle function is depreciated so what is its replacement. i have this function and i cannot convert it kindly help me! function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); }
Get target element with out passing event as perameter
HI all, i need event name on triggering the function that time i am not passing the event as perameter if i put event.target.name it is working correctly in chrome but firefox it is failing
Localization language Portuguese
Hello, Can somewone help me and tell me why doesn't the text apear in Portuguese. <script src="datepicker/jquery-ui.js"></script> <script src="datepicker/datepicker-pt.js"></script> $(function() { $( "#datepicker" ).datepicker( $.datepicker.regional[ "pt" ] ); $( "#datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); $( "#datepicker" ).datepicker( "option",$.datepicker.regional[ "pt" ] ); }); Thanks Jorge Barosa
Tumblr reverse posts order
Hi everyone, I am trying to reverse the order of Tumblr posts by date. BY default Tumblr presents the most recent post at the top of the page. I would like to present the oldest post at the top and so on in that order, with the newest post at the bottom. I am new in using jQuery. I am still understanding the DOM. I saw one solution by jakecigar here to randomize Tumblr posts. But with all honesty to come up with something like that is beyond my jQuery skills yet. Copy and paste will be easy. Besides,
Hoe do you capture and pass data from an input field?
I tried the following two script but neither work. Please advise. Thank you. $("input[name='loanAmount']").mouseleave(function(){ var Amount = $this.attr("input[name='loanAmount']").val(); _satellite.setVar('loanAmount',Amount); _satellite.getVar('loanAmount'); Return true; I also tried this. var Amount = $this.attr("input[name='loanAmount']"); _satellite.setVar('loanAmount',Amount); _satellite.getVar('loanAmount'); Return true;
[Solved] function .toggle() deprecated : what to use instead ?
Hi, The documentation says that the .toggle() function is deprecated (http://api.jquery.com/toggle-event), but there isn't any alternative method indicated. I searched the documentation but cound't find this piece of information. Maybe with .on() and .off() but I don't understand exactly how it works. Well, all I want is to transform the following into something future-proof : var odd = function() { alert("odd"); } var even = function() { alert("even"); } $("#mydiv.toggle(odd, even); Thanks
Showing and hiding elements - Best way to organize the divs
Hello, I always try to show or hide elements and would like if there is a different way to organize numerous div. ie: <div class="main-div"><div id="element1></div><div id="element2></div><div id="element3></div></div> $("#element1").show(); $("#element2").show(); $("#element3").show(); Is there a way to add all of them into 1 class and instead show or hide each element of the class based on an ajax response data. ie: $(".element1").html(data.delivery_charge).show();
jquery add and remove content
Hi guys i have three text boxes in a row on click of add button should add a row with three text boxes and a remove button and on click of remove it should delete the particular row.And one row is mandatory and when we have one row remove button should not appear and should not allow the user to delete a row.
How can i select one object from many objects in a JSON file with this jquery code
I need to get the latest blog post in the top of my page, the main area. All the posts is stored in a JSON file and when i make a new post it should come on top of my webpage to the main area. I also have a menu with all the posts listed. When I click on a "post" it should appear in the main area and when i reload the page again it should show the latest post in the main area. Hoq can i do that with jquery? this is my code so far: This is the JSON file: Code: {
"postHead": {
"title":
multiple jquery functions
I have 3 jquery functions. Do i need to put them under separate functions or i need to put them put into one function? see below: 1. put in multiple functions: <script> $(function() { $('#calc_jyform').calx(); }); $(function() { $("#checkboxID").change(function(){ $("#tableID tr.rowClass").toggle(!this.checked); }); }); $(function() { $('#checkboxID').click(function() { var cb1 = $('#checkboxID').is(':checked'); $('#emailAddr').prop('disabled', !cb1); });
Highlighting active link with JS problem
Hi. I found this script which highligts active link based on page id given in body tag (https://www.youtube.com/watch?v=dRLOHxyCaGU). The problem is that i have same named links in couple of sections on my page, so they get highlighted both at some point. BAND -Members GALLERY -Members MULTIMEDIA -Misc FAQ -Misc <body id="Misc"> $("#Misc a:contains('Misc')").parent().addClass('active'); So, is there any way i could give my links seperate id or something so it would be highlighted only in correct
Stop an executing function
There's a piece of code that runs as a function called upon key stroke, I want to stop execution of the function on pressing another key stroke both outside and inside of the running function, here's the pseudocode. $(document).on("keydown", function(e){ switch e.key { case "a" : /*run*/ myFunc(); case "b" : /*stop*/ myFunc(); } }) function myFunc(){ Some Loop(){ $(document).keydown(/*stop*/ myFunc()); } } How do I make it stop in both ways, obviously to run doesn't need anything, but calling the
jQuery Kaspersky issue
Kaspersky insertion is made - as I found out - at places (or 1st place) where "<script" is found. I changed in minimized jquery following to fix this issue: * this: ... replace(/<script(.|\s)*?\/script>/g,"") ... * replaced by: ... replace(/\x3Cscript(.|\s)*?\/script>/g,"") ... I.e. smaller sign by it's hexadecimal escape. For me this fixed Kaspersky injection into jquery.js, that was a really annoying thing (lost few hours...)
Function fires as it should not : Is this a matter of propagation ?
Hi, I'm new to jQuery (and JS), I'm discovering the powerfulness of this tool. As I'm a beginner, I still do not understand all the mechanics and behaviours jQuery is based upon. So I'm sorry if this question is a poor one, but I didn't found anything about this. I work on a web app with social parts : users may write posts, answer posts, and like/dislike posts. My question is about the treatment of like/dislike functions. Before, you should know that like/dislike informations for a post are displayed
Making a Json Call
I have a click function that works for one of my anchor tags but I want it to work for two (or more). When I click on the anchor with id get-data-1 it displays the json file microLesson1.json for the div with class quiz-list-1. I want it to display the json file microLesson2.json when I click on the anchor with id get-data-2 as well. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test</title> <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
jquery closest() not working to get parent ul
I have a handle the following element as this: <ul class="blog-tags"> <li> demand <i class="fa fa-close"></i> </li> </ul> this.closest('li') returns a reference to the closest li element. but this.closest('ul') returns null. I also tried $(this).closest('ul') which also returns null. I also tried by class name: $(this).closest('.blog-tags') but I'm still not getting a handle to the element. Any idea what might be wrong here?
element insertAfter for each instance
Hi. Kindly asking for help. I have such code jQuery(document).ready(function(leftmapjen) { //moving price and adding class for my styles jQuery('span.ihf-for-sale-price:eq(0)').insertAfter('div.ihf-results-photo:eq(0)').addClass("buy-wdevise-price"); jQuery('div.ihf-results-price:eq(0)').insertAfter('span.ihf-for-sale-price:eq(0)').addClass("label-status label-status-7 label"); jQuery('div.ihf-results-address:eq(0)').insertAfter('div.ihf-results-price:eq(0)').addClass("buy-title");
Creating a toggle funtion on desktop navbar menu item
Hi I am currently trying to create a clickable menu item. The menu item has a dropdown mega menu. I want the dropdown menu to only display and hide when it is clicked, not when hovered over with the mouse. The menu item is called "meny" and has a hamburger icon next to it :) Here's the code I've made so far, but it's not working: <script> jQuery(document).ready(function(){ jQuery(".et_fullwidth_nav #top-menu li.mega-menu > ul").click(function(){ jQuery("this").toggle(); }); </script> my page link
how to get and Id from a report?
Hi guys, Can you please help me Im trying to get an Id from a field that is in a report. How can I achieved that? $('div#my_report')... thanks, Nelson
Location Search
Do location search in a text box. The user will be typing "Ind" for this you will get an response from google API's, If the user selects and location from the list provided by google. Then log the search param("Ind") as well as the google api response in db. In the next search, If the same search param is entered, Then result should come from db and if there is not data in db, Then hit the google api and show the response. I am new to this please help me with answer.
On click success button with sweetalert2 go to url
I cant work out how after the click of the success button below, the page isnt redirecting. <script> if (window.location.search.indexOf('e=success') > -1) { swal({ title: 'Request Delivered', text: 'You can continue with your search.', type: 'success', }, function(){ window.location.href='index2.php'; } )}; </script>
recommend changes
Hi, I am new to jqeury. Could you please tell me how to get the most of this script. I wrote it by myself and there is quite few repetitions. $("textarea[name='storyline']").blur(function() { storylineAjaxUpdate(); eventViewer('Storyline has been saved'); }); var strokeCount = 0; $("textarea[name='storyline']").keyup(function() { strokeCount = ++strokeCount; if (strokeCount > 100) {
Problem with js/jquery staying on same page
Hi, I'm very new to programming and only need it occasionally in my work so my understanding is not in depth. I'm trying to submit a form inside a CMS page and dont want a new page to load after processing the php mail script. Instead I need to display a single line success message (not an alert pop up box) without reloading the page or going to a different page. Here's the code I have and my understanding is that the event.preventDefault should allow to stay on same page and "$( "#contactResponse"
Draw Lines Using jQuery
Suppose on my page I have several objects such as DIVs, Images, Links, etc. Also if I am using an image as my cursor, how do I draw a temporary line from the side of the cursor image to the side of an item on the page when they line up?
Jquery Accessing grouped buttons with all similar attributes in a list
Was seeking help i am unable to access elements in grouped buttons without affecting next element with all similar attributes Example <div class="btn-group"> <button type="button" class="btn btn-primary">Apple</button> <button type="button" class="btn btn-primary">Samsung</button> <button type="button" class="btn btn-primary">Sony</button> </div> <div class="btn-group"> <button type="button" class="btn btn-primary">Apple</button> <button type="button" class="btn btn-primary">Samsung</button>
How to make click function work for dynamically created DIV(say on some ohter click function) with some class or ID?
Hi, I have created div and assign id or class to this div on some clicking event using jQuery. After creating I want to make click function work on this newly created div. But that is not working. Here is the sample code. Thanks in advance. <html> <body> <div id="some_ID"> Click me to create new divs! </div> <script> $("#some_ID").click(function() { var new_div = $('<div class="new_class"> I am created dynamically on clicking </div>'); $("#some_ID").append(new_div); }); $(".new_class").click(function()
Date value in <html:text/> gone on submitting the page .How to maintain it what has been selected from calender.gif on submit?
Hi This is my code : <td class="smallText" width="150" style="padding-top: 10px;"><html:text property="fromDate" styleId="fromDate" maxlength="10" size="9" /> <a href="javascript:void(0)" onclick="displayCalendar();"> <img name="caldrImg" src="/stap-portal/img/calendar.gif" align="absbottom" alt="Calendar" border="0"> </a> </td> function displayCalendar() { setDateField(); // defined in calendar.js top.calendarWindow = window.open('/stap-portal/view/static/calendar.html','cal','dependent=yes,width=260,height=260,left=200,top=300,titlebar=yes');
toggle inline style
Hi how can I toggle (add and remove style declaration) with click(function()) style="left:100px;top:50px;" to get remove <div id="myDiv">content</div> add <div id="myDiv" style="left:100px;top:50px;">content</div> with toggle thank you
Select a dynamically created element ?
It has a classname of listitem so I tried it like this: $(".listitem").css("background-color","transparent").removeClass('selected'); Does nothing!
Problem with for each and Mapbox
So basically i'm having trouble with an click event firing a popup in Mapbox but the real issue is with the for each function. I click the third icon in the sequence and it fires the previous two popups, if i click the second one in the sequence it will fire the second and first but not the third. echo ' var map = new mapboxgl.Map({ container: "map", style: "mapbox://styles/mapbox/streets-v9", center:[' . $longitude . ', ' . $latitude . '], zoom: 15 }); // add markers to map geojson.features.forEach(function(marker)
auto scroll from top to bottom and back in repeat
Hey there, I just set some html-sites for our school infodisplay. The tool Screenly OSE shows the Websites in a shuffle play. Thats all working. But there are a fiew sites with much content. The screen solution will be 1920 x 1080 pixel and these websites will not fit because of there length. So, what code could I implement in my html sites, which include xml.files with php in html? One of these sites looks like this: <!DOCTYPE html> <html lang="de"> <head> <meta charset="UTF-8"> <title>xy</title>
Next Page