Edit in place improve code
This is an edit in place script anyone can help me to improve it? If I update two time the same comment i have a problem. $(document).ready(function(){ $(".comment").each(function(i){ setClickable(this); }) }); function setClickable(obj) { $("#edit_"+$(obj).attr('id')).click(function() { var textarea = '<textarea rows="4" cols="60" name="'+$(obj).attr('id')+'">'+$(obj).html()+'</textarea>'; $("#edit_settings_"+$(obj).attr('id')).hide(); $("#save_settings_"+$(obj).attr('id')).show(); var
how to display a message layer after form-submit
hey all, i'm using the form validation plugin to validate my form (http:// docs.jquery.com/Plugins/Validation), works great. now i want to display a layer or a message after clicking the submit-button. unfortunatly i don't know ho i can do that, thanks in advance for help or every tipp please take a look at my js-code i'm currently using to validate my form: -------------------------------------- my javascript: // JavaScript Document $(document).ready(function(){ $("#signupform").validate({ rules:
.next alternative?
Im trying to make this grab the Next Element with the right name, Even if there is some other element between it.. $(".toggle").click(function() { $(this).next('.contentToggle').toggle(); }); This Works <a class="toggle">toggle</a> <div class="contentToggle">this here is content</div> But this doesnt <a class="toggle">toggle</a> <br /> <div class="contentToggle">this here is content</div>
jQuery Auto-Growing Textarea - extend to top
Hi, I have a problem. Did anybody know how to make "jQuery Auto-Growing Textarea" to extend height but not to down as it is right now but to TOP? So simply the last line of text I'd have always is the same place and the textarea would be growing to top. I'm not master of JS so I need your help.
[jQuery] Global AJAX events, not working?
I've tried like this: $("#loading").ajaxStart(function() { $(this).show(); }). ajaxComplete(function() { $(this).hide(); }) I've triple checked the id of loading image and everything, but still doesn't work. Any ideas what could be wrong?
[jQuery] AJAX global events
$("#loading").ajaxStart(function() { $(this).show(); }). ajaxComplete(function() { $(this).hide(); }) This is my code, it should make the "loading" image visible when ajax is active but this doesn't seem to work, any ideas what am I doing wrong? I've also tried with bind but also didn't work. Thanks in advance!
[jQuery] replaceWith()
I want to replace one element with another, and keep the element contents intact. For example, here, I'm replacing all h2 elements with h3's: $("a #replaceWith").click(function () { var h2Text = $("h2").text(); $("h2").replaceWith("<h3>" + h2Text + "</h3>"); }); I have two questions. First, how can I do this more simply? I tried the following, but $ (this) refers to the anchor tag and not the h2 selector. Is there a way in jQuery to refer to the selector, i.e. $("h2")? $("a #replaceWith").click(function
[jQuery] append help
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=us-ascii" http-equiv=Content-Type> <META name=GENERATOR content="MSHTML 8.00.6001.18813"></HEAD> <BODY> <DIV><FONT size=2 face="Trebuchet MS"><SPAN class=447385216-05082009>I want to add .loading class before an element (#admin_content)</SPAN></FONT></DIV> <DIV><FONT size=2 face="Trebuchet MS"><SPAN class=447385216-05082009></SPAN></FONT> </DIV> <DIV><FONT size=2 face="Trebuchet MS"><SPAN
I need help with auto expanding Text Box
Hello Everyone. I'm a complete newb at JSing/CSS and HTML. I can get by but poorly at best. So I apologize right off the bat. Stuff I'm using- Mac Safari Firefox Dreamweaver GoLive I'm trying to create some "emailable stationary" for a client of mine. It's a very simple design. I read that I can create a webpage and then open that page with Safari, under the menu item File>Mail Page As Safari will then mail the webpage as if it's stationary. Pretty slick and it works from what I can tell fairly well.
[jQuery] Lightbox trigger on domain exit
I have been looking for a solution in jQuery where I display a lightbox which contains an html message telling users that they are getting ready to leave my domain when they click an external link. I prefer to be able to test if they are still in my domain from a list of domains. Does anyone know of any solutions like this?
[jQuery] Pop-up, hover or focus -problem
Hi! I'm making a pop-up Google search-box for my site. However it's something wrong with my jQuery-code. Can you help me? js: if ( $('#Search').hover() || $('#Google').focus() ) {$('#Google').show() } else { $('#Google').hide() }; html: <div id="Search"> <a href=#>Search site</a> <div id="Google" > Google search.. </div> </div> As it is, #Google is displayed all the time. I've had success with only hover, but if the user clicks in the opened search-area, I want
[jQuery] How to modify the url function [validate]
Hi all, This post is about the jquery validation plugin. I am using the url() method to validate text fields for valid url input. It works fine, but I want a slight modification where I am checking whether a base directory has been added and not some individual page. For example, not http://www.example.com/index.html but http://www.example.com. Any way I can modify that url method to satisfy my needs? Thanks, PS. I had a lot of troubling publishing this post for some reason. It wouldn't appear. Please
[jQuery] binding "text" event
Just noticed that a "text" event can be binded to an input: $(’:text’).bind(’text’, function () {console.log($(this).val()}); But it is not documented here. http://docs.jquery.com/Events/bind. Google fails to help either. This event turns out extremely useful when handling Chinese input, but doesn't seem to work in Chrome (works fine in FF 3.5 and IE 8). So I want to dig deeper. Anyone have any idea what this is?
[jQuery] jCarousel External Control as Pagination
Hi there (tried posting this earlier without result), I have a couple of problems using jCarousel, and was hoping someone here might lead me to a solution. First of all, can I change the way the External Control function works? I am guessing that I "only" need to edit the javascript file, but having little knowledge of it, I chose not to. What I want to do, is use the External Controls as a pagination, so rather than being a navigation for each image, I would like it to navigate from one page of
[jQuery] [Linkselect] Change function fires when using "replaceOptions"
Ok, I think I have one last outstanding problem with Giva Labs' awesome Linkselect plug-in. I'm wondering if it is a limitation of the plug-in or if I am simply doing something wrong. I am using one select to update another and everything works perfectly. However, I am finding the "change" function fires when I use "replaceOptions" to update the second select even though I'm simply re-initiating the second select with a new set of options. I think the "change" function should only fire when I do
[jQuery] Forcing JSON parse by headers
Here is a scenario. I am submitting a form via AJAX. The form may either return HTML (when there are input errors) or JSON (successful response). If during request I specify "dataType: 'json'" then HTML doesn't get thru correctly, if I don't then JSON is displayed as plain text. I am sending the "application/json" header back correctly. I don't understand why doesn't jQuery just pick that up and parse it as JSON? Is there an option? Is there something I can do to make this work? Thank you!
[jQuery] [treeview] - How to manually set a persistent location
I'm using the treeview plugin for navigation on our website. It works great but I wanted to be able to override the persist:location when needed. For example, on an e commerce site where items are part of a category, I need to have that tree open to that category. To achieve this, I hacked (and I mean hacked, I'm no jQuery guru, but it works) the jquery.treeview.js file to add another check for a location. Here is what I did. Around line 207 I added this.... if(typeof myLocation != "undefined") {
.serializeArray() and $.post
Hi, I'm just starting to get my head around jquery, so this question is probably dumb, but why isn't the JSON format returned by .serializeArray the same as that required by the data parameter of the $.post method? The two would seem to go hand in hand. Guy
[jQuery] Show/hide on radio button click
Hi all, I'm trying to do a show/hide on a radio button click and I do have it working, but I'd like to make it more...extensible/independent of hard- coding children elements to show hide. My dummy html structure is: <input type="radio" name="donate_by" value="by_cause" id="cause"><label for="cause">By Cause:</label> <ul id="cause_children" class="clearfix"> <li>Please select cause(s) below:</li> <li><input type="checkbox"> Cause 1</li> <li><input type="checkbox"> Cause 2</li> <li><input type="checkbox">
[jQuery] Filter List Items w/ Sub-Lists
I have selected a list that contains sub-lists. Now, I'd like to search for the list items that contain sub-lists (but not including the sub-list-items). I think the example below will explain what I'm trying to do. HTML: <ul class="start-here"> <li>Do Not Need</li> <li>NEED THIS ITEM <ul> <li>Do Not Need</li> <li>Do Not Need</li> </ul> </li> <li>Do Not Need</li> <li>NEED THIS ITEM <ul> <li>Do Not Need</li> <li>Do Not Need</li> <li>NEED THIS ITEM <ul> <li>Do Not Need</li> <li>Do Not Need</li> </ul>
problem with $post() and firefox
I apologise if I have already sent this as I'm new to this site and I thought I had posted this once but cannot see my original post. Here we go again I am new to php and ajax. I am trying to serialise the data in a form id = "subForm" and send then send the data via the $post() . The solution works fine in IE 7.0 but in firefox the data that is echo ed back from the file "http://localhost/registrationAjaxChecker.php" is not received and the callback function is not evoked. I have also tried an example
[jQuery] Possible IE8 Bug with jQuery
I believe I have found a bug in IE8; it's possible that it's something jQuery is doing, but I really doubt it. I'm only cross-posting this here in the hopes that someone can suggest a workaround, because I have tried everything I can think of. A code sample is available here: http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/f265c5b1-a45d-4949-85b2-86a97a884dc1 The issue I'm seeing is that changing the contents of a table cell in IE8 randomly causes the width of the td element
[jQuery] End of animation
Hi all, I would like to know when a set of animations, started inside an "each" function, is finished. In the following example, how can I simply hide the whole #menu element once LI elements have been fully animated ? ------------------- HTML <div id="menu"> <ul> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> </ul> </div> ------------------- JS // add click behaviour $("#menu li").click(function() { // toggle selected item in list $(this).toggleClass("selected");
Highlighting entered characters
Hi all, i know there are a number of flavors of the JQuery autocomplete. I am trying to highlight the input as well as those characters in the suggestion list. I am not sure exactly where that gets set. Any help would be appreciated. Regards
[jQuery] Live function being weird
I have two snippets of code: This one doesn't work $("form[name='edit']").live('click', function() { return false; }); This one does: $("form[name='edit']").click( function() { return false; }); I'm not sure why this is though, are attribute filters not supported with the live functions?
[jQuery] IE click event handling problem
I'm working on a small plugin that extends a checkbox to behave as if it has 3 states. Basically it just adds an anchor above the underlying checkbox, intercepts mouse clicks, and cycles the checkbox between: disabled + unchecked enabled + unchecked enabled + checked It works fine in FF. But in IE7, for some reason, the click events are always sent to the underlying checkbox instead of the overlaid anchor. The anchor is sized to completely overlay the checkbox (and in fact, I made it's slightly bigger
[jQuery] FOR loop corrupting external links from MySql / getJSON procedure
I am doing a FOR loop and creating a list which I am getting from a mysql DB. I am having trouble linking to an external _blank page. i am passing my userID (+uidCN+) and when I do the results sometimes the results list out no problem ...and sometimes it does not. It seems my loop is creating a conflict somewhere....is there a better way to do this? If I just copy paste the URL with the userID it works perfect...very frustrating and have spent way too much time trying to figure this out. my code
jQuery $.ajax to call a wsdl web service
Hello frnds, I have just started using jQuery, and I'm Lovin it . I am currently struck at using .ajx to call a wsdl webservice. I was successful in using $.ajax to call all my wss web services, they just worked great. Now when i'm trying to call a Axis2 web service (complex return xml types), its not working , looking for some inputs frm you guys, .. <script src="http://www.google.com/jsapi"></script> <script> google.load("jquery", "1.2.6"); google.setOnLoadCallback(function() { var soapEnv = "<soapenv:Envelope
onLoading and onComplete Event Methods in JQuery
Hi All I want to use jquery instead of prototype.js my current code in prototype.js is given below pars += 'postId=' + postId; pars += '&comment=' + comment; pars += '&postauthor=' + postauthor; var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onLoading: function(){ var successmsgDiv = $(successmsg); successmsgDiv.style.display = "block"; successmsgDiv.innerHTML = '<img src="<?php echo site_url(); ?>/processing1.gif" BORDER="0" alt="processing" />'; $(buttonId).disabled = true;
[jQuery] Ajax response attached file
Hello, I am doing a Port AJAX request to a PHP script on the server side. This PHP makes a process and generates some files, which it compresses in a .zip file and send it back to the client. The point is I don't know how to manage the PHP zip in the Post ajax methos 'success' function so the user can get this zip as he/she usually download a file form the web. Zip file gets to the browser but I don't know how to make the download action. Thanks
Cant work out correct jquery selector
Hi, I've been going through the jquery documentation trying to find something to do this, but not managed to get anything working yet. I have the following html <div class="container"> <div> <label for="test1"> <select id="test1" name="test1" class="mytest"> <option>one</option> <option>two</option> </select> <div> <div> <input type="text" id="test1b" name="test1b" class="mytest_text" /> </div> <div> <label for="test2"> <select id="test2" name="test2"
[jQuery] edit dialog display issue
Hii..i am new in jqgrid. i have to achieve following functionality.. I get grid which displays all data..now i want to edit row on selection changed. for that i wrote following code as a jqgrid parameters onSelectRow: function() { var gr = jQuery("#list").getGridParam('selrow'); if (gr != null) jQuery("#list").editGridRow(gr, { reloadAfterSubmit: false, height: 450, drag: true }); else alert("Please Select Row"); } I have all gridrows with editable:true... So by that i get the edit dialog , but it
function gt() is not working
When try to refine a jquery set with last elements using the function gt() it just not work. Here is an example, it was tested in firefox 3.5 and jquery 1.3.2. I had placed 3 empty fields, with jQuery I asign a "x" value for al of them. Then I try to asign an "y" for the las two fields using gt() function, but it doesn't work. (Note: that to test it you by copy and paste the code in a html file you need to have the jquery-1.3.2.js in the same folder) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
[jQuery] jquery tabs doesn't work under IE
here is my site: http://testlayout.cba.pl/ tabs don't work under IE - all div's are visible. I should add some code? I thought that jquery works under all browsers...
[jQuery] jqGrid with c#
Hello Friends, I’m using jqGrid in ASP.NET. jqGrid is literally good. As of now, I’m using Handler(ashx) or WebService(asmx) to convert the DataTable into JSON and display in the Grid. Can I use c# code behind and bind the Data? I mean c# method convert the DataTable into JSON? I’m trying, if any one has done or have any idea, please let me know. I cannot use WebService in my project, that is the reason I need to use c# code behind. Thanks and Regards, Achutha Krishnan
[jQuery] How to modify the url function [validate]
Hi all, This post is in regards to the jQuery plugin for validation. I am using the url method to get validation text fields which I want to have a url. But I want a slight modification where I only want to the base directory of a site and not an individual page. For example, I want http://www.example.com and not something like http://www.example.com/index.html. Is there anyway to utilize the url method to do this for me? Thanks,
[jQuery] Show How many text box empty How many text box filled
Hi , Basically am doing something like validation function , Having form with 5 text box , some time user many forgot to enter all field and go for submit , so there i want to show the message Like 3 textbox need to be fill , please fill fields , How to do this sort of functionality , Thanks
Code breaks without an alert() !!!
This one is throwing me. I have a small piece of code that I am using to call a function in dynamic drive's accordion menu script. As long as I leave the alert() line in, it works. Comment it out and the call to expandone() doesn't go through. I must be missing something obvious, no? Here's the relevant part of the code (it is fired from $(document).ready() ): $('.level0').each(function(index){ if ($(this).attr('id') == lev0) { subMenuIndex = index; } }); alert('smi: '+subMenuIndex);
[jQuery] "Unsaved Changes" form validation
This is not JQuery specific per se, but a generalized JavaScript problem. I happen to be using JQuery in my application, so the solution will most certainly be implemented with JQuery. I have a multi-page form which I allow the user to navigate freely before validating and submitting. There is a "save and continue" button, but also an html nav menu that allows navigation w/o saving. Customer has requested that the nav menu also save so users are never suprised to learn they lost any changes they
[jQuery] Superfish as popup menu?
I am in the process of replacing a YUI menu implementation with Superfish. (it is great! thank you thank you!) Is there an easy way to implement a popup menu? Something like: http://developer.yahoo.com/yui/examples/menu/example07_clean.html thanks for any pointers ryan
Next Page