Changing css elements of classes with the same name?
Hello, I have an issue where I can have multiple instances of the same class being used, but only want to change something simple, like the text color, of one or more of this class, but not have the change effect ALL instances of this class. For example, below I have two text boxes, but they share the same class of "mstrmojo-DocTextfield-valueNode" but I want to be able to change the CSS of the text values independently. So, I may want the text color of one to be RED and the other to be BLUE.
CORB Error retrieving a json file
I am trying to recover the data of a JSON file from the following address: http://www.armada.mde.es/ihm/Documentacion/Mareas/json/2018/bonanza/bonanza_2018-07-26.json This is my code: var settings2 = { "async": true, "crossDomain": true, "url": "http://www.armada.mde.es/ihm/Documentacion/Mareas/json/2018/bonanza/bonanza_2018-07-26.json", "method": "GET", "headers": { "cache-control": "no-cache" } }; and I get the result of the attach picture. Some help to solve it? Thanks
Looping throught current select
$("select[id^='ticket_types_']").each(function () { var selectName = this.name; var selectId = this.id; var buttons; $("select[id=selectId] option").each(function () { alert("aa"); buttons += "<input type='button' value='" + this.value + "'/>"; }); alert(buttons); $("select[id=selectId]").replaceWith(buttons); // add a hidden
After Manipulating the DOM, the click does'nt works
Hi, does someone can help me ? After Manipulating the DOM of the row2 in my table, nothing appen; Please see more explanation and my code here : https://jsfiddle.net/xpvt214o/419272/
ajax
hello all, greetings from me guys i have a problem with below script..... function send_inquiry() { $('#loader_img').show(); $.ajax({ type: "POST", url: "<?php echo base_url();?>ajax", data: { action: "product_model.product_inquiry", name: $('#name').val(), email: $('#email').val(), phone: $('#phone').val(), address: $('#address').val(), country_id: $('#country_id').val(), country: $("#country_id option:selected").text(), inquiry_type: $('#inquiry_type').val(), note: $('#note').val(), pin:
2 DatePickers (Start & End Dates): Restrict date range
I'm using 2 DatePickers (Start & End Dates). I want to restrict the date range so that for whatever date is chosen for the Start Date, the End Date can be up to 2 weeks after the Start Date. How would I do this? For Example: I choose 07/15/2018 as the Start Date, so the End Date can be from 07/16-07/29 . Here's my current DatePicker code: <script> $( function() { var dateFormat = "mm/dd/yy", from = $( "#from" ) .datepicker({ defaultDate: "+1w", changeMonth:
Find the ONLY the next, innermost parent element above contains() target element
It occurs sometimes that I want to execute a function only on the next, innermost, certain element above a matching element. Simplified example: <div ....> ..... <div .....> <a ....> foobar </a> ... </div> .... </div> Only the innermost <div> should be removed. Therefore I coded in the past: $("div:contains('foobar')").eq(($("div:contains('foobar')").length) - 1).remove(); It works. However I wonder if there is a shorter way for this condition. The alternative way should also work if there is
Focusout repeats
I have this code that I use for every textbox I have: $("textarea").focusout(function () { //saveComments(); alert("Hello"); }); So if if I leave textbox 1 and click anywhere outside besides clicking any other textbox this code fires once. But if I click textbox 1 and then textbox 2 the focusout goes on repeatedly: "Hello", "Hello", "Hello"...etc. Why does it gets triggered several times when I enter another textbox? How can this be solved?
How do I access nested elements inside a list
I have this code: <li> <div class="wrapper"> <table> <body> <tr> <td></td> <td>Access this text</td> <td></td> </tr> </body> </table> </div> </li> How do I access the text inside tables first row and second cell?
jquery: API JSON example.
I have written the following code (as below) for an API JSON example but I cannot seem to output any information on screen? Moreover, if I use https://jsonplaceholder.typicode.com/posts/1 in my code it will function and output an answer? html: <h1>JSON Example</h1> <span id="output"></span> Jquery: $.getJSON('https://jsonplaceholder.typicode.com/albums', function(data) { $('#output").text(data.title); });
Multiple droppables: How to detect the droppable, which did not accept the draggable?
I'm not familiar with jquery ui in depth and didn't find a solution for the following simple setting: I have a gallery with different kinds of waste and two trash cans, one for paper and one for 'bio'. When the user drags #waste_1 and drops it on #paper everything is ok, because .paper is accepted in #paper. In case that the user drags #waste_2 and drops it on #paper it should revert and #paper should shake. Revert works fine but I didn't find a way to detect the droppable when the waste is not accepted.
Fetch previous and next element with a certain condition
Lets start with a sample source: <hr> <p>....foobar...</p> <hr> Now I want to delete all <hr> elements which are immediately a) BEFORE a <p> element which contain "foobar" b) AFTER a <p> element which contain "foobar" If I code for example $("p:contains('foobar')").prev().remove(); then elements might be delete which are NOT a <hr> element So how can I specify otherwise the delete statement of a sequence of elements with one condition? Peter
Y-m-d format subtracting when set as value
For the life of me I could not understand why when I was storing today's date and then setting it as a value it was coming up as 199* instead of 2018-07-0*. How do I set the value of a text input for today's date in the Y-m-d format without it subtracting? HTML <input type="text" id="delivery_date" name="delivery_date" placeholder="" data-mask="9999-99-99" class="form-control" size="4" required> JS document.getElementById('delivery_date').value = user[0].delivery_date;
Problem with mouseover
trọng điểm Thẩm Mỹ She Spa Lily Maymac vốn nhỏ con thật chứ chẳng hề tiêu dùng ảnh ảo trên mạng đâu, chiếc chính là "hot girl môi tều" sở hữu chiêu chụp ảnh để lúc nào cũng gợi cảm và sexy nên mới khiến cho người ta bất ngờ lúc gặp ngoài đời. Để thực hành phun xăm môi khi không người dùng với thể tới thẩm mỹ viện Tiểu Yết tại số 88, nai lưng Duy Hưng, Cầu Giấy, Hà Nội. bây giờ Phú Quốc đã đặt tên thương hiệu đa dạng cho đặc sản độc đáo này là tiêu Phú Quốc” nhằm đảm bảo giá trị của sản phẩm này tương
using katex.render() in panel crashes
Hallo there, I try to use katex equations within panels, but it dont work properly. How can I use katex inside panels. Where should I call katex.render()....? The code-example is attached.. Thanks in advance! Bernd
jQuery contact form reply showing up on a bank white page not sure why
jQuery contact form and the for, is submitting but the reply showing that it was sent is showing up on a bank white page not sure why, want it in the place were the form is any ideas to help with code????? jQuery(function() { // Shorthand for jQuery(document).ready(function() { // if (jQuery('.comments-form,.contact-form').length > 0) { Modernizr.load([{ load: ['js/jquery.form.js', 'js/jquery.validate.js'], complete: function () { jQuery('.comments-form,.contact-form').validate({ //
Conflicting form ids
I have the following example where I can highlight the select values of a specific column. Sometimes I need to use two forms for the same column (hence the same form id), but it doesn't work when I try this. Is there another solution for this? My jsfiddle example: https://jsfiddle.net/1mt7ojL0/ As you can see in the example, Values.II form doesn't work.
new to coding and jquery code not working
new to coding and jquery code not working please help not sure were problem is?????? please if anyone can help the code emails but doesn't show on screen that it went if (jQuery('.comments-form,.contact-form').length > 0) { Modernizr.load([{ load: ['js/jquery.form.js', 'js/jquery.validate.js'], complete: function () { jQuery('.comments-form,.contact-form').validate({ // Add requirements to each of the fields rules: { name: { required: true, minlength: 10 },
Validation only highlights one field at a time for form requiring checking one of the checkboxes
I had to manually add validation for checkboxes for this Bootstrap page and now only one text field form field highlights at a time. For example, clicking submit once will highlight "First Name", clicking it a second time will highlight "Last Name" and so forth. We need all blank required fields to highlight at the same time. I used to include all form field names below within "rules", but no longer need to do that, since we're using Bootstrap's default validation. However, I haven't found a more
Tablesorter plugin: How to sort text/number column?
Hi All, I have a table with a sequence number column, and the values are like: 1-1, 1-2, 1-3, 2-1, 2-2, ...10-1, 10-2,... I use the tablesorter plug to give the table the sortable function, but when I try to sort the sequence number column, it gives me the order of 1-1, 1-2, 1-3, 10-1, 10-2, 2-1, 2-2,...which is not I want to get. I need it be ordered as a number, not a string (before and after the '-' part). I studied the tablesorter plugin document, and there are no related articles. The only similar
hover working indepedently with identical containers
Hello! I have a .container containing .wrapperA (image) and .wrapperB (image). And use this code to make .wrapperA invisible and .wrapperB visible on hover: $(".container").hover( function() { $(".wrapperB").fadeIn(1000) $(".wrapperA").fadeOut(1000) }, function() { $(".wrapperB").fadeOut(1000) $(".wrapperA").fadeIn(1000) } );EDIT: The problem is that I would like to add
updating code from attr to prop
In the process of moving some jquery code to a site that uses a newer version of jquery, I had to change from using attr to prop as shown below. jquery-1.3.2.js if (!($("[name=jobs_ws]").attr("checked"))) { jquery-1.10.2.js if ($("[name=jobs_ws]").prop("checked")) { After reading up on attr vs prop I'm still unclear on which attr and removeAttr should be clanged to prop in the code below. Currently the only problem is that only in IE11 the checkbox for "phone_appointment" and "have_file" are not
i have two effects that superimpose, the over effect and indicated click tab
this is mi code thanks for our attention: https://pastebin.com/3TdvCBvS
jQuery multiple content sliders?
How can I change the jQuery code below to have multiple content sliders working? When I try and add additional sliders it doesn't work correctly. CodePen https://codepen.io/anon/pen/aKPReW Any help is much appreciated. Thanks in advance! jQuery var allSlides = $('.slide'); var activeSlide = 0; setInterval('autoSlide()', 4000); $(".slider-next").click(function() { if (activeSlide+1 >= allSlides.length) { allSlides.eq(activeSlide).removeClass("active"); activeSlide = 0; allSlides.eq(0).addClass("active");
parsing xml using jquery (malformed xml)
I have an XML that looks like this: <?xml version="1.0" encoding="utf-8"?> <export> <Article URL="test"> <DisplayName>test</DisplayName> <Summary>test</Summary> <ThumbNail ID="test" URL="test" /> </Article> </export> Which I'm looking to parse using jQuery. This works using the following code: $.ajax({ url: 'https://[fqdn]/[filename].xml' }) .done(function(xml) { $(xml).find('Article').each(function() { console.log($(this).attr('URL')); console.log($(this).find('DisplayName').text()); console.log($(this).find('Summary').text());
JQuery UI css and js file locations
I am new to using JQuery UI and I was wondering if the css and js could be stored in different folders or if they needed to be located in the same folder?
Finding the total of array between two indexes.
Hi, if I have an array like this: scores = new Array(5,2,4,6,8,9,10); How would I get the total value of the items from index 1 (2 in this case) and index 4 (8 in this case). So scores would return the value of 20. Thanks in advance.
This drop and drag jaquery is applicable for iframe?
I have used this jquery where is video gallery contains both video and you tube video which are taken from iframe but it seems that video is working for drop and drag and iframe is not working? is there any solution for iframe drop and drag.
Error $x is not defined in chorme console
When i use below code $x("//*[@id='popular-movies']/div[1]/ul/ul[1]/li[1]/a")[0].click() Its working, But when I use setTimeout function with this code $(function(){setTimeout(function(){$x("//*[@id='popular-movies']/div[1]/ul/ul[1]/li[1]/a")[0].click()}, 3000); }()); I got error, $x is not defined Can you help me to solve this?
Flickering behaviour of ui sortable
I have a nested sortable list. No matter what i try, the sortables doesn't work correctly. None of the answers in jQuery forum regarding the issue helped me. When i try to sort second test parent into test child of first test parent the placeholder flickers (violently at times) and vice versa. I have searched for solution but couldn't find any. Tweaking css such as margin and padding may help was the only advice i got. But still no way. I am stuck since months. Here is the fiddle
Jquery card scanner activation, possible?
I'm posting this as a newbie and hope I'm not out of line, here goes. I have found a jquery card scanner script https://github.com/CarlRaymond/jquery.cardswipe also a jquery slot machine web app https://github.com/josex2r/jQuery-SlotMachine When a user taps a button the reels spin like a slot machine. I run a coffee shop, my aim is to issue "Coffee Membership" cards. I will display the juery slot machine in a tablet on my counter. The tablet will have a card reader attached. When a member pays
I can not call plug-in
Bom dia, não consigo chamar a validação do plugin jquery no meu código html, pela CDN como posso proceder?
Click problem
Charm Wiktionary Tiếng Việt Lily Maymac vốn nhỏ con thật chứ chẳng hề dùng ảnh ảo trên mạng đâu, chiếc chính là "hot girl môi tều" với chiêu chụp ảnh để khi nào cũng gợi cảm và sexy nên mới làm cho người ta bất thần lúc gặp ngoài đời. giả dụ chẳng may mang đôi môi xỉn màu, thâm bạn sở hữu thể áp dụng các bí quyết trong khoảng những nguyên liệu đột nhiên dễ kiếm đưới đây để tăng cường nhược điểm, tác động tích cực đến việc đôi môi tươi sáng, mềm mại, đỏ hồng lôi cuốn. 4. Khám phá Gành Dầu: Gành Dầu
using jquery with bootsrap4 and accordion
I am using an accordion menu, and at the moment the last level is the question, the two levels above it are sections and then categories at the top. Everything is fine, but what I want to do at this stage is detect if they go to the question level and open it, but then rather than close it they click another section instead. So if they do on clicking on any other button it closes the question accordion. This is how my question level is set up <div id="accordionQuestion@(Model.QuestionID)"> <div
getJSON and apostrophe/single quote as a parameter value in IE
I have a problem with the AJAX call on IE11 when parameter contains an apostrophe. AJAX call looks like: $.getJSON( "https://fqdn.to.server:8888/pdqm/endpoint", { firstName: self.firstName(), lastName: self.lastName() }, function (data) { //here is some stuff to do with UI } and when using is search for an example O'Connor it create call to https://fqdn.to.server:8888/pdqm/endpoint?firstName=*&lastName=O'Connor which works fine with Chrome and FireFox but when used with IE11 it doesn't encode apostrophe/single
Autosave form every X seconds
Hello All, I'm trying to add auto-save functionality to my form. While I figured out 90% of the things of the overall functionality, I'm stuck at the most crucial one - triggering the ajax call when - 1. Any of the form field is updated. 2. Ajax call is made every 10 second after the change is made. 3. No ajax call is made when the fields are empty I experimented with ``` $(":input").keypress(function() { setInterval(saveDraft(), 5000); });j function saveDraft() { ... } ``` However,
adding different classes when coming from different pages
Hello! On load of my index page, I have a js running: $(document).ready(function() { setTimeout(function(){ $("body").addClass("item1") I am leaving this page to page2 and returning to index. Now I want to add: $("body").addClass("item2") If I come from page3 I want item3 to add. How can I achieve this?
How to sanitize data sent from the server in ajax call ?
I have the following quiz component here. There are 10 questions and on click of the result of the final question , your performance of the over all quiz is shown, the response is fetched though a ajax request (in scripts.js) , like so: $.ajax({ type: "POST", url: $("#quizForm input#QuizResultPreview").val(), dataType: 'html', contentType: 'application/json', data:JSON.stringify(quizAttempt), success:
Highlight highest value in table cell
I have this metod to highlight highest value in table cell: var max = 0; var bg = 0; $(this).find('.my-table').each(function () { $this = parseInt($(this).find('tbody tr:eq(1) td:eq(0)').text()); if ($this > max) { max = $this; bg = $(this).find('tbody tr:eq(1) td:eq(0)'); } }); bg.addClass('highlight'); It kinda works but not as I would like.
How to NOT pass 'Other' option for SELECT
How can I NOT pass anything from a SELECT when "Other" is selected? Selecting "Other" opens a separate text field that'll pass the answer when the form is submitted? FORM CODE <div class="form-group"> <label for="fruit" class="control-label">If you were a fruit, you'd be a(n).../label> <select id="fruit" name="fruit" data-value="fruit" class="form-control"> <option value="" selected>-- Please Select --</option> <option value="Apple">Apple</option>
Next Page