Little help with a loop
I am trying to loop thru a json array of errors specific to a form #id (sel) but it is not working. function setErrors(errors, sel){ errorUpdate(sel); //alert(sel); // returns #add_form $(sel).each(errors, function(field, msg) { //alert(sel); returns nothing var parent = $('[data-field='+ field +']').parent(); $('[data-field='+ field +']').addClass('form-error', function(){ $(parent).append( '<span class="help-inline error-message">' + msg + '</span>'
Hyperlink autoclick on page load jquery
I want a link to get clicked on page load. For this I have added this script in my code: $(document).ready(function(){ $('#id').trigger('click') }); This document.ready() function works fine, If I test it to alert a message. But the link is not getting clicked on page load using this. Can someone please guide me for this?
Change Div using Li in html and jquery
I have few div (may be 4 or 5) , and Color Brand Master Cards Color - Red Master - MySelf i want to show div GetCol and hide other all , when Color(GetCol) list clicked. same way for GetBrd .. etc.... I hope u understood Pls advice regards
Jquery doesnot work with out alert .
Hi All, Updating the Dynamic DIV style works with alert() only. Getting records from the DB using JSON, trying to change the background color of the DIV using the JSON value. Thanks, Saran
Bind this function to a second event
I have a function that executes when a specific <select> field has its value changed: $(document).on('change','#form-register .gfield_list tr td:first-child select', function() { However, I'd also like the function to run whenever the page is reloaded, is there a way I can do this simply with the on() method?
Change content inside height
I want to change the height of an image with jQuery. But I do not want to change that with Css Normally jQuery performs this work with CSS Without CSS, how do I do it? And Directly change the content of height="" ? Thanks
Using this with a target
I can output this() to a console.log(). How do append it to a div as I cannot chain this(). $(document).ready(function(e) { $('a').click(function(){ data = $('a').attr('data-urlrdir'); console.log($(this).data()); }); });
Issues in displaying child div while parent div is hidden in jquery
I am creating a script,which creates a dropdown and certain divs dynamically.Based on the dropdown value I want to display a particular child div.The Php script is shown below. PHP Code $status_box='<select class="lang_select" id="lang_select"> <option value=-1 selected="selected">Select Language</option>'; while($var=$db->fetchRow($res)) { $status_box.='<option value="'.$var[0]. '" id="'.$var[0].'">'.$var[1].'</option>'; } $status_box.='</select>';
Image Flickers when reloading on Ajax request. Can it be solved with Jquery?
I have a page that displays graph image which is refreshed every second via ajax call. The problem I am having is that image flickers every time it refreshes. I was told that I could solve it with jquery library but I am new to it and have no idea where to start. Can someone look at my code and let me know if this is a quick fix or point me in the right direction? Here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Need Help With JQuery.deferred
Hello Everyone: I hope this question is in the right forum. I'm using jQuery fullCalendar and having trouble with asynchronous execution preventing a proper refetchEvents. In research I found out about jQuery.deferred, but can't seem to properly execute a refetchEvents AFTER posting new events to the php file. Following is my script as it now stands: // Now that you've grabbed returned data from ol_LogEdits.php and created arrays, send the new arrays to ol_postActivity.php for INSERTing
Push [getJSON] values into a local varialbe array - MVC4
Hi All, How to we get Json values to a local variable array? My Json Get function: var dataArray = []; $.getJSON("/Role/GetSeasonsRatesJson", function (myData) { $.each(myData, function (i, item) { dataArray.push([item.FromDate, item.ColorValue]); }); } Will return following value pairs: var _myData = new[] { new { FromDate = "01122013", ColorValue = "Red" }, new { FromDate = "02122013", ColorValue = "Red" } }; Not able to access the values in local
How to animate without miss in performance?
Inspired by this website, www.adhamdannaway.com i did my own version http://americanhorizon.altervista.org/portfolio/portfolio5.php The problem is that animation for enlarge and restrict boxes is very slow performed with jquery. It's the only method i know to do it adding some easing effects.. If i don't use animate method all works fine, but i loose the easing effetct!! exemple there http://americanhorizon.altervista.org/portfolio/portfolio3.php adhamdannaway website instead uses easing without
Invalid JSON - Fatal error: Cannot use object of type carrito as array in
Dear Friends, I've already checked a long list of details and can't find the solution. I have a website hosted on two different servers, with the same exactly OS and PHP version, while on one host the script works without any issue, on the other host I get the following error: "Invalid JSON: <br /> <b>Fatal error</b>: Cannot use object of type carrito as array in <b>/home/username/public_html/lib/class/cart.class.php</b> on line <b>186</b><br />" What could it be? Any help will be much appreciated...
Store server message in a variable
Hi everybody, I'm developping an app with Arduino Yun controlled by a web page with Javascript/Jquery. From Arduino Yun (server) I receive in the web page some data with this statement: function monOn(){ handle = setInterval("showGetResult(function(data){$('#cont').text(data);});",2000); ...... This statement work without problems. But I woul'd make some formatting on the received text. How can I store the received data in a Javascript variable? I've already tried
Problem with mouseenter
I have a div assign as height:40 width:100% position absolute top:0px When I go to do a mouseenter it is only activating when I get to the very top of the div. On the border ... What am I doing wrong ... Im using this to stop some css hover activity overlaying my text fields $("#cssmenu").on("mouseenter", function(e){ $("#cssmenu").css("zIndex", 9999); console.log('cssmenu enter'); $("#S1").css("zIndex", -1); $("#tabs").css("zIndex", -1);
Simple selecter event not working
I have the following HTML: <div class="social"> <div data-link="#" class="icon-fb"> </div> <div data-link="#" class="icon-twitter"></div> <div data-link="#" class="icon-linkedin"></div> <div data-link="#" class="icon-git"></div> <div data-link="#" class="icon-vimeo"></div> <div data-link="#" class="icon-youtube"></div> </div> Trying to build a quick selector so I can attach
load(XML page)
I am attempting to load a remote XML page that is not local (on my server). Realizing that I can't do this with jQuery, I've set up a proxy PHP page using SimpleXMLElement which I had then hoped to load() into a div on my display page. When I view the proxy alone, it's perfect. When I call it into the div on the display page, it comes in as unformatted text. Is there a way that I can maintain the integrity of the proxy display when calling it into the display page? Thanks in advance -
attr name in IE 11 appears as SubmitName
Hi folks, I know it has been talked a lot on this issue but I need some info on how get rid of it. I've a form in which I've the possibility to add additional inputs through jquery by doing some cloning. Afterwards, I just do an attr on name but as mentioned on the topic name, it replaces it as SubmitName. So basically, I can't retrieve after submitting the form, all the values inside inputs which have name replaced by submitName. here is a sample of my code: var uniqueLeg = 1; $('.addInfo').click(function()
how to pass input text parameter with $.get method in jquery
<script> var focus=document.getElementById("acctype").innerHTML; $( "#acctype" ) .focusout(function() {$.get("fetchacc.php",{ name:'" + $(#acctype).val() + "'},function(data) { $('#acctypeDES').html(data); } ); }); </script> In above i have passed input text value using .get method.. I expect input text value instead of " + $(#acctype).val() + "' like.. name:50 but it doesnt work... It returns following error value " + $(#acctype).val() + " acctype is the id
think i have linked my scripts in wrong
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Welcome to Groundswell</title> <link href="_css/main.css" rel="stylesheet" type="text/css" media="screen, projection" /> <link href="../../../../../jquery/Ex_Files_jQuery_EssT_2013/Exercise Files/07_realsite/Groundswell_Start/_css/sunny/jquery-ui-1.7.2.custom.css"
Mathematical issue (/100*100)
I today had a strange "bug?" showing up. In one of our clients' applications there is a calculation that calculates the amount of hours that need to be worked every month. It counts the amount of days that they are supposed to work on, multiples it by the needed hours for a day and then uses a percentage to calculate how many hours really need to be worked. Thus: If you have 14 days to work that month it's 8*14 = 112 hours. If you do work 100% it should return 112 after you do the math 112/100*100.
Send form input to function
Hi; I need to send user input to a function so it reads a div onkeyup. I have done what I thought but I need help to pass the user input to the function and then to the other page that gets reloaded (and I dont know how). This is the page. The input field under Search By Suburb. This is the code that calls the function on okey up: <div class="col-md-6"> <div class="panel panel-info"> <div class="panel-heading"> <h3 class="panel-title">Search
Div tag disappears after postback
I have jquery adjusting the height and width of a div tag but when there is a postback. The div tag disappears. Does anybody know how I should keep from this div tag from disappearing after a postback? Thank you, Shawn
PART 2: HOw to use localStorage to create an array used to hide certain table rows...
I have narrowed the code issues down to one last spot. I can't seem to get the code rode to .hide() the table rows TR based on the localStorage values. The following code creates the localStorage and then tries to hide the TR that contain the localStorage values. full jsfiddle here: http://jsfiddle.net/vhabhsrosed/qd5kJ/ thanks so much in advance for any advice. I'll keep trying to figure it out but //THIS updates LOCALSTORAGE AFTER EACH CHECKBOX CLICK. USE ON PAGE 1 $(document).ready(function
After called "unbind" event i'm unable to "bind" it again
Hi, iv'e this simple problem $( window ).mousemove(function( event ) { console.log('diocane') //some stuffs }) $('#header').mouseleave(function(){$(window).unbind("mousemove"); dimensioniHeaderDefault()}) $('#header').mouseenter(function(){$(window).bind("mousemove");}) The problem is that on mouseleave the mousemove event for the window object is correctly "unbidden" (i do not see "diocane" into the console) But once mouseenter again into the header element, it should re-activate the mousemove
Manipulate client-side Sql databases
What about this API for client-side sql databases ? http://dev.w3.org/html5/webdatabase/ I think that it is interesting.
Trigger function working in all browsers except chrome
Hello and thanks for the superb forum!! Im using a script where you can add a postal code on a form which will be sent to an iframe. It works in all browsers exept for Google chrome. This is the code im using: <?php if (isset($_POST['postcode']) && !empty($_POST['postcode'])) { ?> <script> $( document ).ready(function() { $('#sd-iframe').load(function() { $('#sd-root').trigger('setFieldValue', { name: 'postcode', value: '<?php echo htmlspecialchars($_POST['postcode']); ?>' }); });
Integrating custom javascript into a CMS and the "TypeError: $ is undefined" error.
I'm nearly finished integrating a wrapbootstrap theme into Drupal. But the custom js (which words perfectly outside of Drupal) is making drupal ornery. I was getting a js "TypeError: $ is undefined" error in: http://noname.com/sites/all/libraries/bootstrap/js/ace-elements.min.js:" I surrounded the code in ace-elements.min.js, as per [ https://drupal.org/node/171213 ], with the following and fixed that error. But now I get a: "TypeError: ace.settings is undefined" in: http://noname.com/sites/all/libraries/bootstrap/js/ace.min.js:
Problem with jQuery processing logic
Hey guys, I've got a problem with using jQuery for changing class-attributes of some DOM-Objects. I've gote some Code like this: $(document).ready(function () { $('#bundles').click( function () { $(this).toggleClass('bundlesNegativ', 'bundles'); [...Some Code that isn't relevant...] arrangeNote(); }); $('#singles').click( function () { $(this).toggleClass('singlesNegativ', 'singles'); [...Some Code that isn't relevant...]
populating dropdown using jquery
Hi, I am new to jquery. I am trying to populate second drop down based on the value selected on first drop down. I am able to implement up to this point. The form have a continue button. If the user click continue button next page is loaded which have a back button. If the user clicks on back button previously selected values should be automatically selected. I am able to re-select first drop down but second drop down is not getting populated as it is happening on change event of first drop down.
Jquery post issue. Loads wrong file!
Hi; I use this code below to load a new page in a div. This is the page that gets loaded into the div. As yoy can see it is only an array. But for some reason when I click show number it loads the same page again in the div, not the requested page. Can anyone see what the problem is? Thank you function view_phone_number(id) { $.post('http://test.goldcoast-flatmates.com/phone_number/'.id, { id: id, <?php echo $this->security->get_csrf_token_name();?>: '<?php echo $this->security->get_csrf_hash();?>'},function(output){$('#phone_number').html(output).show();});
problem to add result in database with jquery
hello, i have a problem to add my result in my database, look at my code : index2.php <!doctype html> <html lang="en"> <head> <meta charset="iso-8859-1"> <title>Calcul mental</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/foundation.min.css"> <script src="http://code.jquery.com/jquery-latest.min.js"></script> </head> <body> <div class="row"> <h1>Calcul Mental</h1> <div class="columns large-12"> <h2>Quel est le résultat de ? </h2> <div
Best ComboBox Solution
I have a question regarding Comboboxes. After a few searches i've seen a number of different versions of Jquery Comboboxes. On my site I need to populate a few comboboxes from a database table. Can someone please forward me to a good site with sample code of the simplest yet effective solution. I'd probably prefer to code it myself but i'm open to other options. Please Help..
Notification
Dear forum users, I made a jquery notification system and it works! BUT... I want to make it like fade in when it shows. But it don't work! I don't know why. Could someone help me out? The script.js is down on this page!!! index.php <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="script.js"></script> </head> <body> <script type="text/javascript"> notificatie({ type: "error"
Superfish does not show properly over Flash file on Explorer
Hey everyone, I'm setting up a Superfish horizontal menu. The menu is in a div, and just below that on the page is another div with a swf flash file. On Explorer, the menu drop down looks like it is opening up under the swf flash file. As if the Z-index is messed up. Is there a fix? It works fine in Firefox/Chrome. Thanks for any help!
Show and Hide
Hi, I want to show and hide a div element using jquery, but not in the default show hide method. Example: if i use $("div").show(slow); means its taking from TOP LEFT CORNOR to DOWN RIGHT CORNOR, insted of that i need from TOP RIGHT CORNOR to DOWN LEFT COENOR. How to achive this. Thanks
Help! Problem with simple script
Hello, I'm taking a few steps in jquery, but I have a problem that had not before ... by clicking on the input type = "button" with id = "btn-send", the # result is not shown .... I can not find the solution you ... I would appreciate your help. <script type="text/javascript" src="js/jquery-1.9.0.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#resultado').hide(); $('#btn-enviar').click(function() { $('#resultado').show(); }); }); </script>
IE8 Jquery settimeout crash every 3-4 days
I have this html page running on IE8 and it crashes every 3-4 days. Is it something wrong with the use of settimeout here? I also used proxy and it did not help. But it can run on Firefox with no issue. <html> <head> <meta charset="utf-8"> <title>jQuery.proxy demo without proxy</title> <script src="C:\Documents and Settings\xc91977\Desktop\JqueryLib\jquery-1.9.1.js"> </script> </head> <body> <div id="log"></div> <span></span> <h1></h1> <script> var me = { _panelRotationTimeout:
How to use common jquery drag and drop code with two divs containing elements of identical ids
hi all, I have common jQuery function for drag and drop and two div tags. Both div tags have different ids but both containing elements of identical ids. I have a block and a placeholder for each so when i drag 'block1' olny placeholder of first table should be blink and but both are blinking. Here's link to my fiddle - http://jsfiddle.net/2pFqe/3/ In jsfiddle i have two divs of id, 'id1' and 'id2' both containing elements of same id. Now when i drag block1 both placeholders are blinking. I have
jquery AutoComplete and AutoFill Issue
I have a secure web-based application consisting of several modules, one for customer information that contains a form with several input fields. The first field is for the customer code. I have implemented the jquery AutoComplete script for the field. I would also like to implement an AutoFill script so that once the customer code is selected via the AutoComplete (and tabbed to the next field) the remaining fields could be entered by the system. The AutoComplete works just fine but I cannot get
Next Page