Reset CSS in validator
Hi, I am using jquery validator to validate the form and setting the backcolor of the element: errorPlacement: function(error, element) { element.css("background-color", "red"); }, I want to know when unhighlight , how can I reset the css style to its original / default css? Thanks, Jassim
Send decimal number as json parameter to web service
Hi, I have a json call that consumes a web service, it request several parameters, all of them string, but one of them is a decimal, something like this for example "2.21" as string, however, jQuery keeps crashing with error "500 undefined" if that parameter contains a dot, however if I change it to comma, it works, but the number is stored in the database as integer, with no coma, this my my code: function addReportLine() { var productVal = $("#productCode").val(); var nameVal = $("#productName").val();
Issue on Using Mouse Slow Event with Raphaël.js
I am trying to use the hoverIntent.js with Raphaël.js at This Demo to handle the handlerIn function not immediately and waits until the user's mouse slows down enough before making the call of any function( like Hover) but I am getting this error: Uncaught TypeError: Failed to execute 'animate' on 'Element': The provided value is not of type '(AnimationEffect or sequence<Dictionary>)' Can you please let me know why this is happening? and does Raphaël.js has any built in function to do the same job?
send an Html var using $ajax
Hi, Im trying to make a inline-edit table (it work) with jquery. But i need to customized some cells with html ( <br> <b> </b> ) nothing extravagant :) My problem is that my var in truncate with there is a html tag My code function saveToDatabase(editableObj,column,id,tableToUp) { $(editableObj).css("background","#FFF url(loaderIcon.gif) no-repeat right"); $.ajax({ url: "saveedit.php", type: "POST", dataType : 'html', data:'column='+column+'&editval='+editableObj.innerHTML+'&id='+id+'&tableToUp='+tableToUp,
Sorting divs by multiple conditions
Hi I had to replace a table list with a div-layout because of a desired hover-effect (additional info appearing when hovering over a row) before, I was able to sort the table with a jQuery-Plugin (tablesorter). there I had the possibility to sort by multiple columns. for example, first by rating and then by title Now i have the problem, that I don't get it to sort by multiple conditions. with 1 row, it looks like this: $divs = $('.container'); var sortData = 'title'; var sortDir = 'asc';
Having Issue on Assigning Functions to JavaScript Object
Can you please take a look at This Demo and let me know why I am getting following error? when I try to use $(boxes.BC).hover({ alert("You Are On BC"); });
print only image on click
I need the image should print several times the page fits on button click http://jsfiddle.net/8dXvt/591/
how to change a div class based off a variable.
Hi I have this static div on a page: <div class="stars stars-40"></div> I have a variable called {rating} in my template. The variable is always in .5 increments, .5 to 5.0 and I have the appropriate classes in my style sheet. If the rating is 3.5, I want to change the class in the div to: <div class="stars stars-35"></div> What is a good way to do this? I was thinking in jQuery I could do this: var s = '{rating}' . replace ( /\./ g , '' ); to strip out the decimal. But I'm not sure on how
How to add a number of dropdowns based on the value in a dropdown?
Hello I am tasked with a form where you select a number of kids 1 - 9, and based on the number selected, is the number of dropdowns I want to appear where they select the ages of those kids (ages 1-18). What is a good way to do this in jquery? Thanks. -JBD
Having Issue on Using Data Attributes with jQuery and Raphaël.js
Can you please take a look at This Demo and let me know why I am getting following errors while I can get access to `data-prov` by using the ` var prov = $(this).data("prov");` This works when I hard code the snippet like: $(this).hover(function(){ BC.attr({fill: "#ccc" }); }, function(){ BC.attr({fill: "#000" }); }); but using the jQuery('ul li').each(function(){ var prov = $(this).data("prov"); $(this).hover(function(){ console.log(prov); prov.attr({fill: "#ccc" }); },
Stylesheet switcher --> Buttons for PREV & NEXT
Hello everybody! I have a simple jQuery Style Switcher, which can apply new stylesheet from additional CSS file . It's working with standard buttons --> each button applies different style. But I just want to add two buttons more to this navigation: previous & next (with loop). I have tried to make it by myself but without success.. Here is working demo in Plunker: LINK Function $('.list a').click(function() { var rel = $(this).attr('rel'); $('.content').fadeOut(500,
Grab API content into div
can someone help me to grab content from this API link and insert into DIV: http://api-sandbox.tiket.com/search/flight?d=CGK&a=DPS&date=2014-05-25&ret_date=2014-05-30&adult=1&child=0&infant=0&token=742942779004ba9450c4cf332f16cfe748c81c7f&v=3&output=json thx for your help
ultra simple code: why is not popping the alert window?
I click on an 'a' link tag and the value does get passed to the var selectedlanguage, but then continuing down the code, the "alert" does not pop when supposedly returning from the Controller. Looks like it does not get this far. <script> $(document).ready(function(){ $('.choose-language').on('click', function() { var selectedlanguage = $(this).data('value'); $url = '{{URL::route('languagechooser')}}'; $.post($url,
From html <a tag to ajax and from ajax to a controller, but no value being passed
Hello I have been trying around elsewhere, and although they tried their very best, it still is not working, and we dont know why. It is about clicking on a link, passing that value to the Ajax code and that Ajax forwards it to a Controller. But when I var_dump to see what the Controller gets, it just shows NULL. <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Select your Language<b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="{{URL::route('language')}}"
Can't remove style with Jquery
Hi Guys, I'm trying to figure out how to create a responsive menu here: http://framework.c4242423.myzen.co.uk/ I've been using this tutorial: http://www.hongkiat.com/blog/responsive-web-nav/ It all works apart from one bit which I cannot figure out... When you resize the browser and expand the menu, and then hide the menu, the <ul> has display:none applied. The idea is that if the window is then expanded, some script removes that style: $(window).resize(function(){ var w = $(window).width();
Do I need a loop?
I am creating a one page WordPress website and I am having trouble with some jquery. I have several pages and maybe several more that need to have a custom scrollbar on the page. I have the scrollbar working great. All I have to do is create a div, give it the class of scroll and I am in business. My problem is that if a new page is created and the content of that page isn't greater than the default height of the div which is 400px, then the scrollbar still shows on the page. So I thought I would
$.getJSON sans réponse
Bonjour, J'ai adapté cet exemple sur internet : Code HTML : <!DOCTYPE html> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Request json test</title> <script src="jquery-2.1.4.min.js"></script> </head> <body> <a href="#" id="getdata-button">Get JSON Data</a> <div id="showdata"></div> <script> $(document).ready(function(){ //attach a jQuery live event to the button $('#getdata-button').live('click', function(){
Is there any way using jquery to detect multiple keyboards/keypads/mice on single/one computer?
Hi all, anyone can help me? i have plan to create a web base app, like a sport judging app. it is the live scoring system that need more than one keypad for judge to input scores. how can i detect the correct keypad's input to the correct judge's ID on database. in easy word: judge number 1 pressed his keypad, and system should input given score to the database on judge number 1's field. i hope jquery can handle this. if anyone know and can help me to figure it out, i appreciate it very much. Thank
$.Post jquery.1.3.2 vs jquery 1.6.2 ActionrResult receive params with null - Please help me.
Hi all, I have a web project with c# .net vs2008, mvc 2.0, framework 3.5, nhibernate and jquery librarys. In the solution, normally i use a jquery version 1.3.2 to do a post, and controller receive params correctly. Now, i have a new form that i need to use a new version of jquery (1.6.2) but now when i do the post action, the controller receive the parameters with null value. I debugged the javascript, and from jquery function, the object have all values correctly, but after call to the controller,
When I open the app I get an object error
Hi Guys, Can anybody shed some light on why I get an object error on certain devices when I open the app? It also does not happen every single time you open the app but randomly and also not all devices experience this when opening the app. Any thoughts?
Jquery
Hello All, http://www.jqueryscript.net/demo/Drag-Drop-File-Upload-Dialog-with-jQuery-Bootstrap/ Can we get the above link functionality on page load instead of button click popup? Thanks Please help how to
[ASK] How validate textarea if any code in values?
How validate textarea if any codes like php, jquery, html ..etc I usually use this , for validate if textarea empty? var txtcontent = jQuery.trim($("form textarea[name='txtcontent']").val()); // email field if(txtcontent == "") { $("span.txtcontent_val").html("fields empty."); val_holder = 1; } so why if any code in textarea and i want replace with <blockquote>..code...</blockquote> Thanks
Ajax with css content as data
When I post a simple data with ajax to the server it works fine. Now I need to post some css content and I want the Php code in the server to create and write this code into the created file. So actually I need help on both sides: How to post and how to treat it in the Php. Can someone direct me how to do it? Regards I. lesher
Timing Issue ?
At least I think it is a timing issue but I could be wrong. I have a web page that loads an Ordnance Survey (UK) map into a window and then needs to add a series of overlays containing my own data. The overlays do not always load with one or all 'missing' when the page is loaded. The situation is worsened when the page is refreshed. And which overlay file(s) is missed seems to vary randomly. <body onLoad="initialiseMap()"> triggers the sequence and the following code forms a part of that sequence:
Variables not updating?
From what I have read, my variables should be dumping their data and getting new data when I call the function again. I cannot figure out why my code isn't doing this though. When the page first loads everything seems to be working. The function runs, and it grabs the price/qty. When I click .switcher-label, or any of the other elements listed below it doesn't change the variables though. They just stay the exact same as they were when the page first loaded. I have no idea what is going on here,
How can you embed jquery variable inside a href
Hi, Im trying to create a href tag with the prod-id and qty that the user entered. $(document).ready(function () { $('#qty1').blur(function() { var qqq = $('#qty1').val(); }); }); Input field <input type="text" name="qty1" id="qty1" autocomplete="off"> Id is part of a class... and contains the product code $product1->id The a href thats not working.. it must contain the Id and qty <a href=\"index123.php?qty1=" . javascript:(function(){$('#qty1').val();}."&prodid="
How can i give space between navbar fixed with div
Hello Guys i'm creating website that has feature one page, i have been figure it and succesfully scroll and fixed the nav bar, but now i face problem that when i click the href page scroll go away not as wish, i mean in this issue my page go the top it make not good looking for user, My wish now how can i give some space or height between my navbar and div, Thanks http://sharethingz.com/js-jquery/jquery-smooth-scrolling-to-an-element-on-page/ http://stackoverflow.com/questions/14667829/how-to-create-a-sticky-navigation-bar-that-becomes-fixed-to-the-top-after-scroll
How to get the telephone code of a country detected geonames ?
Hello, I use the function of Geonames to locate countries where we connect. And my problem is that I have to fill in a phone number field at the beginning with a telephone code, this telephone code depends of the country. In my solution, the code works if I select a country, but when the page is initially charged (detected by Geonames country), the country is displayed but I do not get the phone code. What is the solution? Example : country = FRANCE telephone code = +33 In my code : country = FRANCE
.filter() vs. .find() on detached elements
I have detached a set of elements and am trying to unhide them. I could swear the selector/context version has been working but suddenly stopped. Now only the .filter() version works. var $currentSchedule = _$classSchedules.children().detach(); //Unhide any elements that were hidden by filters $(".filter-hidden", $currentSchedule).show().removeClass("filter-hidden"); //Does not work $currentSchedule.filter(".filter-hidden").show().removeClass("filter-hidden"); //Works I've read someone explaining
A few easy questions
Hello, everyone, The question is rather simple. How do I ( with example, please ) ; 1. Create a simple update/delete user interface 2. Use at least one jQuery UI, such as sortable, draggable, dialog,... ) 3. Add a jQuery animation Thank you in advance! :D $(document).ready(function(){ var API=" http://193.246.33.24/data/ " var users = $("#users"); $.get(API, {user:13}, function(data){ $.each(data, function(i, usr){ addUser(usr); }); }); function addUser(usr){ users.append("<tr data-id="
Checbox help
Hello, I have this code here. http://jsfiddle.net/max33/8wr7rjLj/ I have 3 issues which I can't solve. 1) When a checkbox is unchecked, the all highlights should be clear. 2) I can't select and highlight more than one parameter. 3) I'd like to have select all and unselect all too. Can someone help me or guide me. I am a newbie on jquery. thanks.
paste text from the clipborad into a file
I need to paste text from the clipborad into a file. Is that possible and how? Regards I. Lesher
TV wave warp effect
Is this effect possible with jQuery ?
How to use Ajax DataType "JSONP XML"
Hello my friend, I'm a newbie in Jquery. I have a project that use Ajax to read XML from another domain (cross domain). I tried to read by normal way but no luck. And i discover DataType in Jquery 1.5 is "JSONP XML". But i can't use it. This is my code: $(document).ready( function () { var ok, ok1, ok2, ok3, ok4, ok5, ok6, ok7, ok8 setInterval(function () { $.ajax({ crossDomain: true,
Why is event parameter forgotten after recursion?
Consider the following code: <html> <head> <meta charset="UTF-8"> <title>title...</title> <link type="text/css" rel="stylesheet" href="jquery-ui-1.10.4.custom.css" /> <script type="text/javascript" src="jquery-1.10.2.js"></script> <script type="text/javascript" src="jquery-ui-1.10.4.custom.min.js"></script> </head> <body> <div id="dialog1" style="display: none"> <p>some text</p> </div> <input id="but1" type="button" value="clickme" /> </body> <script> $("#but1").on ('click', {valu: 1}, f); $("#dialog1").dialog({
rich text field with image
Hello, i wanted to know how to determine rich text fields state (null / not null) if it contains only an image.
Creating a jQuery mobile menu with toggle submenus
Hi I would love to create a vertical menu for mobile devices. As we know, mobile devices don’t yet support hovers used for the display of sub menus. I would love to give mobile users the ability to click on the main portion of the parent menu item to link to the item page. To toggle down (and up) submenus the user has to click on the arrow area on the right of the button where I appended a transparent <span> area. This process is very important in mobile web design as it gives mobile users the ability
Timing and speed of multiple sliding divs
Please see this fiddle I have set up. You are first confronted by three links. Each link triggers divs to slide out. The link 'john smith' slides out and in at the speed we want. When it slides out the first line slides out then when that is completed the second line slides down as though coming from the first. When it slides back it does the same motion at the same speed but reverse i.e.. the second line slide back up first and then when that is completed the first line slides back to the left.
move the contents of a div to another div
I have a div structure such that: <div id="MainDiv"> <div id="fromDiv"> <div id="NewContents"> </div> </div> <div id="toDiv"> <div id="ExisitngContents"> </div> </div> </div> Now i want the jquery to move(append) the NewContents from fromDiv to toDiv such that the new structure will be <div id="MainDiv"> <div id="fromDiv"> </div> <div id="toDiv"> <div id="ExisitngContents"> </div> <div id="NewContents"> </div> </div> </div>
How do I insert when a given in the search field and if it does not aperecer type a select ...
How do I insert when a given in the search field and it does not exist aperecer type a select with a button where I can add that given in the table where did the research , as shown.
Note : The search filter longer works.
Next Page