Javascript for Accordion - Open one at a time
Hi, If someone could help me create javascript for an accordion I have created that would be awesome. I'm wanting it to do the following: Only open one accordion item at a time I'd like the page to load and have all the accordions be closed by default as well even if they were saved in their open state by accident. I would like it to slide quite smoothly as well from one accordion to another. I have created the accordion for SharePoint publishing pages. my HTML is: <div class="panel1" id="accordion">
check value of multiple check boxes
I am using the following code to check the value of multiple check boxes if ($('#ForenameUnknown').is(':checked') || $('#SurnameUnknown').is(':checked')) { // my code } this runs my code if at least one of them is true i want to replace this code with something that checks the value of all checkboxes on the form in a single statement something like this if ($('form > input[type=checkbox]').is(':checked')){ //my code } (I would want this to run run my code if at least one is checked or
add and remove elements is not working properly
I have a form that allows a user to create custom questions. The user needs to insert the title for the question and then choose the type of the question (text, long text, radio button, checkbox or select menu). If the type of question is a radio button, checkbox or a select menu it should appear a div "#availableOptions" that shows by default two input texts so the user can insert some option values. When this "availableOptions" div appears there is also a button "add new option" that when is clicked
How to edit, clone, save & hover elements
How to edit, clone, save & hover dynamically added elements my code is below please help: https://jsfiddle.net/ringaz/sa8xdh6x/ I Cant seem to get the value of item in a list on my edit button My Hover is not working right, if i hover on one element all of them are showing the hover result.
simple jquery problem
Hi. I have this simple jquery: <script> jQuery(document).ready(function(){ jQuery("#mostra").show(); jQuery("#nascondi").hide(); jQuery(".categoria-seo").hide(); jQuery("#mostra").click(function(){ jQuery(".categoria-seo").slideDown(1000).show(); jQuery("#nascondi").show(); jQuery("#mostra").hide(); }); jQuery("#nascondi").click(function(){ jQuery(".categoria-seo").slideUp(1000); jQuery("#nascondi").hide(); jQuery("#mostra").show();
Why date form field is appearing with current date by default?
I have a page to edit the administrators of a post. This page has a form with some radio buttons, each radio button corresponds to an administrator. I have this jQuery that receives an array with the administrators of a post from the controller and populate the details of each administrator in the form when the corresponding radio button is selected. The issue is that, there is also a radio button "Create new admin" and when this radio button is clicked the form fields should reset. The issue is
Change source file in a script?
I have an audio element with a playlist. When I click on one of the songs it takes the filename and displays it in a div with the id of nowplaying. EG. $("#nowplaying").html("<p>" + $("#myaudio").attr("src").split("\/").pop().trim() + "</p>"); This is working fine. Now I am trying to load in a text file of the lyrics for each song. I have this script that loads a text file into the html in a pre element: var x; { x = new XMLHttpRequest(); } function getdata() { x.open("get", "06 - All The
toggle class for each item with only one function
Hi ! I have many boxes with same class : <img data-id="1" src="showhide.svg"/><div data-id="1" class="box"></div> <img data-id="2" src="showhide.svg"/><div data-id="2" class="box"></div> <img data-id="2" src="showhide.svg"/><div data-id="3" class="box"></div> When I click on one img I want to toggle class for the box with the same data-id (no idea how many boxes I have and what data-id it is) to get : <img data-id="1" src="showhide.svg"/><div data-id="1" class="box expand"></div> if I click
How to edit, save & hover dynamically added elements
How to edit, clone, save & hover dynamically added elements my code is below please help: https://jsfiddle.net/ringaz/sa8xdh6x/ I Cant seem to get the value of item in a list on my edit button My Hover is not working right, if i hover on one element all of them are showing the hover result.
Device-min-width query is not supported in Media query
Hi, While I'm using device-min-width is not working, but min-width is working. Anyone know why it is not working? Is there any other way to use device-min-width Query?
Hello world! I need help!!! I'm at a dead end. I cannot deduce picture from database. I use Ajax(jQuery) with PHP & DB phpmyadmin Ajax request
Hello world! I need help!!! I'm at a dead end. I cannot deduce picture from database. I use Ajax(jQuery) with PHP & DB phpmyadmin Ajax request $(document).ready(function(){ // code to get all records from table via select box $("#employee").change(function() { var id = $(this).find(":selected").val(); var dataString = 'empid='+ id; $.ajax({ url: 'getEmployee.php', dataType: "html", data: dataString, cache: false, success: function(employeeData)
Print documents using Javascript.
Hello, Are there any way to print office document(unstructured document), PDF, images using java script or any other design approach could print documents, except any ActiveX and vb-script. Thanks
change form action is not working - form not defined
I have a form that allows users to edit the administrators of a post but also create new administrators for the post. So this form has some radio buttons. Each radio button corresponds to an administrator of a post. When some radio button (administrator) is clicked the details of the administrator are populated in the form fields. When the "Update" button has clicked the details of the administrator are updated. But then there is a static radio button, "Create new administrator", that allows creating
Set the value of textbox and hidden fields are both not working
hi guys this simple script is not working. Please help Everything works except lines 17 and 18 (even the alert works) html elements are <input type="hidden" name="cropx" id="cropx" value="0" /> <input id="Text1" type="text" value="" /> I have also tried replacing html with val e.g $('#cropx').val(c.x); thank you $(document).ready(function ($) { $('#Image1').Jcrop({ bgColor: 'red', onSelect: function (c) { $("#ehi").click(function
JCrop is undefined - Conflicting Jquery Script
Hi guys, I am struggling with conflicting Jquery scripts, using asp.net mvc core 2. Whenever I add the layout page which has its own jquery library for bootstrap it gives the error (JCrop is undefined) If I block jquery in the inspect tool in chrome, it works. What can I do ? here is my code The only difference between the two pages, is that the main page (line 5) has the reference default layout in .net MVC which is Layout = "~/Views/Shared/_Layout.cshtml"; Also I am attaching the chrome network
jQuery in Salesforce causing vulnerability issues
Hi, We are using jQuery within Salesforce to develop the typeahead feature. However our app did not pass the Salesforce security review and they have asked us to fix the issue. I am not very sure, how to fix the issue and how to test this so that it does not happen in the future. Please find the issues listed below. I don't have any familiarity with jQuery and I am wondering if by using a later version will solve our issue. Any suggestions will be really helpful. Thanks *******************************
Uses Passive Event Listeners to Improve Scrolling Performance
Hello, Is jQuery v2 or v3 using passive event listeners to improve scrolling performance (mostly for smartphones and tablets) ? Look at Google talking about that : https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners Thank you.
How to use jQuery to load the values in the form fields when the corresponding radio button is selected?
have a form that has some radio buttons. Each radio button corresponds to a registration type of a conference. For that I have this code: @foreach($registrationType as $rtype) <div class="form-check"> <input class="form-check-input" type="radio" name="radiobutton" id="{{$rtype->id}}" value="option1"> <label class="form-check-label" for="exampleRadios1"> {{$rtype->name}} </label> </div> @endforeach Below the radio buttons, the form has some fields
Jquery ajax NEVER passing data to php script
Hello, It seems my code is NEVER passing data to my php script. I'm using xamp as "server"... here is how I coded : $.ajax({ url: "phpscript.php", type : 'POST', contentType: "application/json; charset=utf-8", data:{user_id:'user_id'}, dataType : 'text', success: function(result){ console.log(result);}}); My php is soooo simple <?php $value = array(); $value['id'] = 'ok' . $_POST['user_id']; echo json_encode($value); ?> console.log(result) says : <br
How to add Custom headers in ajax call
when i send ajax based call to api without header then it's working fine but i add some custom header like Authorization then it's does not add the header and i am getting error... any one is there who's help.... $("#Loginform").submit(function () { var token = localStorage.getItem("AccessToken"); var username = $("#username").val(); var password = $("#password").val(); $.ajax({ url: $(this).attr('action'), data: {
Is it possibe to use {} in jquery?
Hi, Currently i'm are developing something on Joomla and Hikashop. From Hikashop plugin there is code that i can use to get the product data. Here is the code i can use in joomla article. {product}1|name|cart|quantityfield{/product} Here is the part for calling the other detail. jQuery.each(ac, function(index, value) { jQuery.each(value.unmet_quotas, function(subindex, subvalue) { jQuery.each(subvalue, function(subsubindex, subsubvalue){
Bradley Witham- jquery
Hi, i am Bradley Witham I am new in Jquery can anyone tell me. Is jQuery replacement of Java Script. Thanks, Bradley Witham
reset form fields when check input is checked
Hi, When the check input "Create" is checked I want to reset all the form fields. Im using the js below but its not working, do you know why? <form method="post" class="clearfix"> <div class="form-row"> <div class="form-group col col-lg-6"> <label for="options">Options</label> <div class="form-check"> <input class="form-check-input" type="radio" name="exampleRadios" id="" value="option1">
What's wrong with my code?
Hi I try to follow this video https://www.youtube.com/watch?v=ZQhR5RbJ2sk I want to create a clone of my image but no luck Please look at my code: <html> <head> <script src="http://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> <style> .zoom{ position:absolute; top:40px; } </style> </head> <body> <ul> <li><img src="rosa.jpg"> <h2>Tshirt Rosa</h2> <button type="button">Comprar!</button> </li> <li><img
Is there any way to write more generic code in below code?
Hello All, I recently started coding. Please help me to write more generic way of writing below code. function set_selection(elem) { switch(elem.id){ case "div_SortCost" : if(elem.id == "div_SortCost") { if(btnSortNumber.elem !=null) { btnSortNumber.disactivateSelection(); } if(btnSortCost.elem!=null) { btnSortCost.activateSelection(); } if(btnSortHour.elem!=null) { btnSortHour.disactivateSelection(); } } break; case "div_SortHour": if(btnSortNumber.elem!=null) { btnSortNumber.disactivateSelection();
"UPDATE" INSTEAD OF "ADDING" A NEW IMAGE?
CODE: https://codepen.io/juscelinobarao/pen/bLLdZx The above code always displays a thumbnail when an image is chosen. But if I choose three different images three times - or not - the code will list me three different thumbnailS with the three images. How to discard the previous image when choosing a new image, without listing all the chosen ones? -- Atenciosamente Juscelino Barão
Both popups are appearing at the same time instead of one after another
Hello, look at these two popups that i have created. Click here to run the popup script https://www.w3schools.com/code/tryit.asp?filename=FOJZTU4EISW8 first popup is "image of a house with click here text" second popup is "name/email etc. submit form" now the problem is as you can see on the "Tryit editor", both popups are visible at the same time. but i need the first popup to appear first and when a visitor clicks"click here" text, first popup should disappear and email submit popup should appear.
How to execute a click() on this web page tab?
At first a (german) sample web page: https://www.wikifolio.com/de/de/w/wf0futecus In the middle of the web page you will find four "tabs": - Handelsidee - Portfolio - Analyse - Trades By default the first tab "Handelsidee" is enabled. Now I want to apply (in a Greasemonkey script) a jQuery statement which automatically clicks on the tab "Portfolio" when the web page is loaded. How can I achieve this? The following does NOT work: $('.js-tab__link.c-wfdetail__tab-link.gtm-portfolio-tab').click(); What
how can i resolve minus value o/p
hi good aftn. if we give minus values from 0 to -11 then the output should be as minus value i.e -11.if we give greater than -11 that is -12,-13 likewise then the output should be the given respective minus value.Have to resolve this using change event. for ex: if textbox1=-8 then the output should be -11. if textbox1=-20 then the o/p should be -20. please anyone help me....
Get Selected item from dropdownlist
I have two dropdownList. One parent and the other child. Selected item in Parent drives the selected item in Child on Parent Changed. Now on Edit I want to highlight only the selected item where their ID's match in each of the dropdowns. Any help will be appreciated.
Problem regarding ajax post request
Hello, I'm trying to make ajax post request to google calendar api, but no posting is happening and the data which i want to post is in this form { "summary": "Title", "start": { dataTime: "2018-02-12T12:00:00"' }, "end": { dataTime: "2018-02-12T13:30:00"' } } calId and token i've not given because of confidential information Please Help Here is the code- var newEvent = function(start, end){ $('#m_modal_6').modal('show'); $('#add_event_submit').click(function(){ var title
amount changed in td
Hi, i have a table displaying numeric amounts from API let say <td>50</td> i want to add a separated span whith the amount changed on the last 24 hours something like $('td').changed in 24hrs get data ito span any ideas?
Rookie here :) Need help on coding jQuery performing Dynamic search filter
I think the javascript is conflicting with jQuery because the checkboxes doesnt work but when I remove the script type (Bolded code) the check box functions. I have a search box that I created and the goal is to be able to dynamically search on the list and values of what the checkboxes shows. Basically what this does on my page is when a check box is selected it will filter based on "my" which is their list. Now I need to add a search function that is based on "my" or "all" so it will search/filter.
position in jQuery 3.3.1
Just upgraded from 3.2.1 to 3.3.1 and now some positioning of something I was doing before is off.... I have an image that I am getting the position of: var position = img.position(); position.left in 3.2.1 is 1379 position.left in 3.3.1 is 1 For some reason I can't get to the blog.jquery.com to see the release notes to see if it is something that is changed or if it is some kind of bug....
How to convert e-05 to 5 zeroes
Hi When I am trying to parse some data like 0.00004265 jquery print like 4.265e-05.How can I convert it back? Sorry for my English.
Uncaught TypeError when clicking on navigation buttons
Hi, I have the code below that is relative to a page that has a multi-step form. For the navigation between the steps I'm using bootstrap and jquery. The issue is that when some step navigation button is clicked it appears on the console the error: Uncaught TypeError: Cannot read property 'nodeName' of undefined in the tabs.js file in the line 155 that is: if (container.nodeName === 'UL') { // line 155 Do you know where can be the issue? HTML: <div class="bg-light-gray2"> <div class="container
TypeError Ajax is not a function
Hi, I'm quite blur in which part is causing this error (TypeError $.ajax is not a function) Already try almost every solution i found on the internet. <script src="https://code.jquery.com/jquery-2.2.4.min.js" type="text/javascript"></script> <script> $(document).ready(function() { console.log($.ajax); }); </script> <script> //listing charity in dropdown list $.ajax({ type: 'GET', url: 'http://ayambrand-com-my-v1.cloudaccess.host/index.php?option=com_echarity&format=raw&task=api.get_charities',
Using ID's to create a URL
This snippet logs ID's from span element into the console. Can someone help me with which method(s) will format my ID's into a string separated by /? My goal is to append one URL with that string. I've been messing around with many variations, and I'm able to append a URL, but it logs each ID as a separate URL. For example, the ID's are latitude and longitude. If there are two ID's logged to the console, it displays twice.. https://www.google.com/maps/dir/Current+Location/LATLONG https://www.google.com/maps/dir/Current+Location/LATLONG
Why my objects names are not shown on the chart ? can anyone help me please?
Hello please can any one tell me how to resolve this issue? I have created this web page to show statistics about products sold in each date, but its seems thts not working, it shows me NaN! But If I go on navigator to see source code of the page, I can see my objects names! Im using Java EE, Spring Framework. this is a screenshot: And this is my code : And thts what It shows in the " Show source code of the page " on Chrome navigator :
Remove duplicated rows when looping a HTML table that was added dynamicaly with append()
Hello please can any one helps me to finish this ; I have created this web page for ordering one/more products, now on the topside, when I select a product and its quantity, when I click the " Ajouter" button it goes on the list below, my problem is when I add 2 same products they appears in 2 rows while I just want them in one unique row and then I should ocmbine their quantities. the table below is created by an append(), when clicking the "Ajouter" BUTTON, so every element on it,is added dynamicaly,
Next Page