Textbox Input Validation
I would like to use jQuery to validate numbers entered into my textboxes on my webpage. I would like to validate it to make sure that it is: A number In the range 0.100 to 10.000 To 3 decimal places I have the following code - but how can I expand it to suit my needs: $('.numbersOnly').keyup(function () { if (this.value != this.value.replace(/[^0-9\.]/g, '')) { this.value = this.value.replace(/[^0-9\.]/g, ''); } }); Any help would be greatly appreciated!
$("*").not() problem?
It seems that the .not() function isn't working if the '*' selector is used: this example code should display the last h4 element in black, but it isn't. I haven't found any documentation yet that describes this behaviour... <!DOCTYPE html> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("*").not("#mytag").css("color","red"); }); </script> </head> <body> <h2>Lorem in red</h2> <h4>Ipsum
Make diagram with jquery
Hi guys! I want to make diagram with jquery. Using someone about it? Thank you advance!
How do i track facebook likes and shares on my page from google analytics
Hi all, I am working on some marketing campaign and require help to fix this issue. I would like to track event on google analytics such as facebook likes and share. How can i fix this? Thanks!
keydown and .which on Android
We're using the keydown event on a text field and determining which key was pressed using the 'which' property. This works on all tested browsers (desktop chrome, safari, ff, iOS safari) unless on Android. The .which property is 0. Are there any known issues with keydown and Android? The 'keyCode' and 'charCode' properties are also returning 0 on Android. Thanks!
Problem when i am converting Xml to sting using JQuery
var xml = "<rss version='2.0' xmlns='http://www.w3.org/1999/xhtml'><channel><title>RSS Title</title></channel></rss>", xmlDoc = $.parseXML( xml ), $xml = $( xmlDoc ), $title = $xml.find( "title" ); /* append "RSS Title" to #someElement */ $( "#xyz" ).append( $title.text() ); /* change the title to "XML Title" */ $title.text( "XML Title" ); /* append "XML Title" to #anotherElement */ $( "#xyz" ).append($title.text()); $xml.find("channel").append($('<title>test Title</title>')); alert((new
How do I prevent jQuery from inserting the 'xmlns' attribute in an XML object?
Below one is i tried:- var xml = "<rss version='2.0' ><channel><title>RSS Title</title></channel></rss>", xmlDoc = $.parseXML( xml ), $xml = $( xmlDoc ), $title = $xml.find( "title" ); /* append "RSS Title" to #someElement */ $( "#xyz" ).append( $title.text() ); /* change the title to "XML Title" */ $title.text( "XML Title" ); /* append "XML Title" to #anotherElement */ $( "#xyz" ).append($title.text()); $xml.find("channel").append($('<title>test Title</title>')); alert((new XMLSerializer()).serializeToString(xmlDoc));
A complete example that focus on the url address
I have removed everything except what I want to ask about. That is why the cursor focus is at the wrong place and the ugly meny is displayed.. Here is how this works. 1. Click on the button 2. Now A very small JQuery-UI dialog is displayed. 3.Focus the cursor in the text field 4. Press function key F4 which will create another JQuery-UI dialog 5. Now as you can see why is the cursor focus in the URL address.You can also see that in addition a very ugly meny that is connected to the URL address in
can`t connect to jquery.com
Hello! I can`t connect/enter into basic website jquery.com and all his subdomains, but i can connect to forum (oh!) Please help me. This trouble happend few days ago, and i still can`t download jquery library or read api, using jquery UI. etc. P.S. Sorry for my bad English. I`m from Ukraine.
How do I format numbers in a table
I have a table with data. I want to add commas to the numbers in the table. How do I do this with jQuery? http://jsfiddle.net/mattellenburg/eH7ge/1/
Div expand/close toggle with extra function?
on the same toggle function.. i have a empty space next to div that i would like to put a background picture or div that is right top corner but when i toggle any of the div's or expand all.... i want the background pic/div to hide... If you have any ideas it will be greatly appreciated... http://jsfiddle.net/4SVXt/23/
Get the viewport of a div element
Hi everyone, i have a div element within another div element. The outer div element is smaller than the inner and has overflow set to scroll so i can scroll the 1000px width and height in my outer div. <div style="width: 100px; height: 100px; overflow: scroll;"> <div style="width: 1000px; height: 1000px;">some text</div> </div> How can i read the current viewport of my outer div element? I want to get the height and width of the upper left corner of the inner width when im scrolling with the
Hide and Toggle function
Hello frnds......... I am trying to collapse and expand links. My format is like this mainlink1 -->sublink1 -->sublink2 mainlink2 -->sublink1 -->sublink2 Initially my sublinks is hidden when i clicking on mainlink it's expand.I am using jquery hide and toggle function. But My problem is when i click on sublink my mainlink is collapsed but i want to expand my mainlink until i click on other mainlinks. Plz anybudy help me............
Ajax to set a variable
Hi i am using the following ajax call to try and set a value of a variable, then display this in a alert. When the alert comes up all it says is [object] [Object]. I have successfully used a different function in the tenHsServer.aspx. This is the first time i have tried to retrieve a value, am I right in thinking I can set a value to a variable like this?? var StatusCheck = $.ajax({ type: 'GET', url: "http://192.168.0.34:81/tenHsServer/tenHsServer.aspx", data: {
Chrome not executing an appended script block
Hi I'm having a problem with Chrome and jQuery where I'm appending a script block to a page and I want the script to execute when it is appended. This works fine in every version of FF and IE I can find, but not in Chrome. Please see the attachment for a simple example. In FF and IE you should get a 'hello world' alert when you click the page, but in Chrome you get nothing. Does anybody know of a way to get Chrome to execute a script when the script is appended to a web page? Thanks Dan
WOW Slider: Why does this thumbnail disappear on the second lap?
Friends, We've been playing with the WOW slider to create a jQuery slideshow. We created this test: http://cleverdesign.com/dev/brynwood/slider/. But look closely, when you get to the second "lap", the first thumb (logo) drops out. Doesn't show. The next image and thumb appears fine, but the first one is nowhere to be seen. Any thoughts on why this would/could happen? Thanks in advance.
Looking for grid example with edit buttons
I'm very new to JQuery and now trying to learn how to create a grid. I need to place a grid within a tab. I need the grid to be able to be editable. there needs to be a button or something that allows the user to edit any cell within the grid. I'm looking for an easy example that I can use to get me started. I'm using ASP.Net MVC3 Also, I'd like to see how I can style the grid to make it stylish and cool looking not just grey.
$.ajax not working in chrome but is working in firefox and IE
Hello all! Running into an issue that I don't understand. I'm hijacking any clicks on an anchor tag and making an ajax call with it. While this works perfectly fine in Firefox and IE, it errors out in Chrome. This is the portion of the code that is getting an error. $("a").on("click", function(a){ a.preventDefault(); var path = $(this).attr("href"); $.ajax({ url: path, success:function(result){ $(".contentgrid").hide().html(result).fadeIn("fast"); } }) }) In firefox and IE, the request fires off
callback not working
Hi, I'm new to jquery and i'm trying to call a method on load and which will perform some task and once task is done i need to display the info. Everything is working fine but callback is not working. <!DOCTYPE html> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> <script> $(document).ready(function(){ getall(function(){ $("P").append("<br/>call back done"); }); }); function getall() { $("P").append("<br/>page loaded"); } </script>
mouseenter/mouseleave... but ONLY when leaving either the current item OR popup?
Hi, I've been going round and round in circles with this for ages :( Basically I have a setup similar to: <div class="link-listing" id="link_123" rel="123"> some content here </div> <div class="link-listing" id="link_124" rel="124"> some more here </div> <div class="link-listing" id="link_125" rel="125"> some other here </div> <div id="preview_link_box"></div> What the code does, is pick up when we enter a .link-listing, and grab some AJAX content based on the "rel" listing ID it grabs.
How do I find which text field
I have three input text fields and when I click F4 I display a jQuery-UI dialog which mainly consist of a html table this works fine. I select a row in the html table in the jQuery-UI dialog by double click and in the event handler I can extract the values from the selected row. All this work fine. Now starts the problem because I can click F4 and display the same JQuery-UI dialog in all three text fields I must be able to know which text field I standing in when I double click in the html table
Contact Form Spam Protection
I have a client that is tired of getting spammed from his contact form and he has asked me to come up with a way to combat this problem without using a hard to read captcha. Here is what I found. This video explaining how to use JQuery to submit a form on element change. View it here https://www.youtube.com/watch?v=pVnCkotKFLs The plan is to make a drop down menu the has the default option ( Not Human ) and another option ( I'm Human ) and then give instructions that to fight spam after all the
using pushstate() & popstate()
I've got a page that loads() php files depending on what navigation item is clicked. I want to adjust this so the user can go through history, and also in an attempt to make the loaded pages crawlable. But, it seems to be over my head. I can't get anything to work, and not sure what I don't get. I've gotten to this point // function for navigation clicks $("#top_nav li a, #footer_info").live('click', function(e){ e.preventDefault(); // highlight active nav
Transparency over jQuery slideshow
Friends, We are removing a Flash movie we did several years ago on a site and replacing it with jQuery. We are trying to do the effect shown here in Flash where the static transparency block goes over a slideshow: http://www.thefortress.com. Our jQuery slideshows fade-up/out along with the pictures, we'd like to have the block simply stay there. Thanks for any assistance.
Auto Populate with jquery
hey guys... What i am trying to achieve is have one input form populate another. $(document).ready(function(){ $("#cr").change(function(){ $("#LDL").val($(this).val()); }); }); This code works great. If i put "1" in the text field and click out it will populate the LDL field with 1, What i would like is to enter number "1" in the CR text field and output "CR=1/". Is there any way of making it Static? Here is the Fiddle! http://jsfiddle.net/bBrF7/ Any help would be greatly
Loading remote website and get element position
Hi. I'm looking for a way to get every anchor element (<a>) position in remote file (the same server). I'm able to load this file to variable or another element but I can't get elements positions. (I also don't want to display this remote file). Is there any way to do such thing? Pls help. Regards, Emil
JQuery dynamic active menu
Hello jQuery Gurus. I have a menu dropline menu which works on static url's but not on dynamic url's. if the url is : http://mydomain.com/packackage1 - it works. But if the url becomes: http://mydomain.com/packackage1/?glexx=namecheck&name=sefsese - it does not wrok Can anyone help me? HTML: <div class="wrap"> <div class="nav"> <div class="table"> <ul class="select"><li><a href="index.html"><img src="/assets/custom/images/btn_home_current.png" width="23" height="20" /> </a></li></ul> <ul class="select"><li><a
Jquery slideToggle bumps the entire layout out page out of whack
Hello all: Created a main tester page. http://www.danielamorescalchi.com/coreCorp/index.php# The jquery function uses slideToggle to open/close the footer. At the bottom right corner there is a button (orange w/star(for now)) so if the user clicks on it the footer comes up. It works but it disrupts the rest of the layout. How do I change this so the footer slides up w/out everything else moving? I thought at first of changing the height of the core of the page (the wrap)and the position of the wrap's
How do I change the html for dynamically added content
On my site there is a dynamically created popup. Unfortunately I don't have access to the code that creates it, but I want to change the html after it is loaded like this $('.check_out').html('<div id="text">Check Out </div><div class="arrow-right"></div>'); $('.continue_shopping').html('<div id="text">Continue Shopping </div><div class="arrow-right"></div>'); I am restricted to jquery version 1.4.2. How do I do this?
Spring Spring-JS vs JQuery form submit
I am working on a Spring Webflow project that was builded with Spring-JS but the firm is requesting me to change the following code to use JQuery. I am NOT a JavaScript/JQuery programmer so I do need some help with now.. Below is working code that on a change of a selectbox (called borough) it will change the _eventID(need it for webflow) to loadSchools and then do a form submit of everything on the pages. I been trying for days to get this working in JQuery but nothing is working Below is the old
Append a table to a div then style it using css
I have this data i am getting from the database and creating a table out of it. $.get("getall.php", function(data){ $(.tablebody').append(data); }); I am then trying to style it using css .current{background-color:pink;} $('tr:first-child').next().addClass("current"); The row isn't being given the background.
Code seems to stop working at the AJAX call
I have a the below function that should send an AJAX request to nuke_authorize.php,however: there's absolutely no sign of the call being sent. Because if the page is ever loaded/request, it writes something in a text file. However, there's absolutely no text file being created/wrote to. (if the below code is hard to read, view it here it here: http://paste2.org/G16U7IgO) function verifyLaunch(code1, code2, code3, code4){ window.clearInterval(interval); var panel = $('#panel');
JQuery Expand / Collapse but with hyperlink
Hello, I am using the following code to expand/collapse some text, it works great. However the user wants to be able to send a link to someone so it automatically expands that article e.g. http://website.com/news/variableNews1 or http://website.com/news/variableNews2 Not sure how to do this, was thinking of using anchors but not sure how to make it expand that way, thank you for the help. HTML: <div class="heading"><h1>News 1</h1></div> <div class="expandable"><p>Text goes here</p></div> <div class="heading"><h1>News
Setting Metatags Problem
Hi, i want to dynamically update the meta Tag "keywords" and "desciption". I know or think, that the search-engines cant read the tags, when i change them via $(document).ready. I have tried: $(document).ready(function(){ $('meta[name=keywords]').attr('content', 'Test1,Test2,Test4'); $('meta[name=description]').attr('content', 'Test Description'); )}; But when i look into the source-code, there are no changes... Updating the "page-title-attribute" works! document.title = 'Test'; Any idea ?
Transformar variável String em Array
Olá Pessoal, Sou novo no jQuery Eu tenho um form onde o input é feito através de um array : HTML <input id="atividadeTecnica" ... jQuery var ativTec = null; $("#atividadeTecnica").each(function(){ this.id = "atividadeTecnica[" + contador +"]" ; ativTec = $(this).attr("id"); }); ... var escolha = $("#pan1").val(); $(document.getElementById(ativTec)).val(escolha); // OK até aqui funciona ! Mas quando eu tento passar essa variável para uma JSP ela não identifica que "atividadeTecnica[0]"
JQuery Ajax - problem with arrays
Hi, I'm trying to send some data to server using ajax method. The code is: $.ajax( { "dataType": 'json', "type": "GET", "url": sSource, "data":aoData, //using different combinations of $.param(aoData, true) here doesn't change anything "success": fnCallback } ); where aoData looks like: [ { 'name': 'name', 'value': [1,2,3] }, { 'name': 'name 2', 'value': 'abcd' }, ] (http://www.datatables.net/examples/server_side/custom_vars.html) The problem is that this data reaches
Using jQuery with Spring Webflow. How do I pass everything in the form
I am having a issue with Spring Webflow and JQuery. I am using JQuery to check for the user changing the value in a dropdown box but once the user selects a new value in the dropdown box I need to change the eventID so spring webflow knows what I am trying to do and to post the fall form with all of the html.. Here is the old code that used to work before the firm requested that I removed dijit and use jquery only <script type="text/javascript"> Spring.addDecoration(new Spring.ElementDecoration({
load popup window
i am able to load popup window but when i close the pop up is there way to get it back when i click on id "media" I want to get popup window back when "Media " is clicked $(document).ready( function() { // When site loaded, load the Popupbox First loadPopupBox(); $('#media').click( function() { }); $('#popupBoxClose').click( function() { unloadPopupBox(); }); $('#container').click( function() { unloadPopupBox(); }); function unloadPopupBox() { // TO Unload the Popupbox $('#popup_box').fadeOut("slow");
toggle function not working
javascript: function collapse_nav(e) { alert("xx"); getColor = $("#" + e.id).css("color"); //alert(getColor); if(prevAboutNav!="" && prevAboutNav!=e.id) { $("#nav_"+prevAboutNav).slideUp(); } if(prevAboutNav!=e.id) { $("#nav_"+e.id).css("background-color",getColor).slideDown(); } $("#expand_readmore").slideUp(); prevAboutNav = e.id; } <div id=about_redmore> Sed ut perspiciatis unde omnis iste natus error sit voluptatem a dolor sit amet, consectetur <div id='expand_readmore'> onsequences, or
fancybox-related jquery error: Uncaught ReferenceError: ...is not defined
Fancybox glitch. When a link on a particular page is clicked, this gravity forms fancybox pop up window should apppear (as it does on all other pages). But on one page, instead I see just the ajax waiting circle appear and then disappear with the following error showing up in google chrome "inspect element" window: ReferenceError: gformInitDatepicker is not defined This is what appears to be the relevant fancybox functions.php code: ---- <script type='text/javascript'> function ajax_shortcode_run_<?php
Next Page