jquery

JQuery Validation Plugin: Prevent validation issue on nested form

I have a form on which I use validation. This form has a section for photo upload. Initially this section contains six elements with the following code: <img class="photo_upload" src="image/app/photo_upload.jpg"> I have bound a function to the click event for the class of photo_upload. This function replaces the image with a minimal ...

How to Get id's of all inputs inside the form?

How to get all id's of input elements inside a form in an array? ...

jquery function inside .ready

Could anyone tell me why 'function()' right after .ready is needed to make the script work? <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2>...

Intercepting static and dynamic links using javascript

Hi, I'm currently developing an ajax application and I'm looking for a feature that lets me intercept all static and dynamic links using javascript. The links look like these: <a href="link1/">link 1</a> <a href="link2/">link 2</a> etc. I then want the browser to redirect to: current.page/#link1/ rather than current.page/link1/. I'm u...

jQuery select last word after = (equal symbol)

I'm using $(this).attr("href"); to select the href attribute value of the clicked element, but I need to select only the part after the last '=' symbol. Example: href="index.php?con=123&id=123&sel=heyhey" I only need the last part of the href that is 'heyhey' How can I select this?? ...

how to link to WebMethod when using jQuery treeview?

I'm using jQuery treeview plugin to populate a child treeview once click a folder node to expand. but $("#tv").treeview({url: webservice/webmethod}); but doesn't work, and failed to call webthod. How to make it? Thanks. ...

tabs reload ajax

I want to add to this simple file ... When you click on a tab updated contents of the page or reload $(function(){ $('#tabsSlide #nav li a').click(function(){ var currentNum = $(this).attr('id').slice(-1); $('#tabsSlide #nav li a').removeClass('current'); $(this).addClass('current'); $('#ta...

Can't get jQuery and IE to be friends

Using jQuery and the Cycle plugin. Runs flawless in Safari, Chrome, Firefox, and the latest version of Opera. Won't run in older versions of Opera, and of course, IE. I know its running Java, because its picking up the rollovers. This is driving me batty. Hopefully its something simple. Here's the code... $(document).ready(function() {...

jQuery plugin design pattern for using `this` in private methods?

I'm creating jQuery plugins using the pattern from the Plugins Authoring page: (function($) { $.fn.myPlugin = function(settings) { var config = {'foo': 'bar'}; if (settings) $.extend(config, settings); this.each(function() { // element-specific code here }); return this; }; })(jQuery); My c...

JQuery $.ajax doesn't return anything, but only in Google Chrome!?

Hi All, I'm hoping someone can help me with this as I'm at a loss. I'm trying to simply load a plain text file into a page at runtime using jquery- everything works fine in IE8 (8.0.7600.16385), Firefox 3.6.3, however in Google Chrome 5.0.375.55 the "data" comes back as nothing- i get an empty alert box. This is the code i'm using; <...

jQuery replacing an image inside a .net datalist

(submit said I was trying to post an image so I've changed image everywhere to <img> I am trying to get jQuery to replace an <img> inside a datalist. The original <img> is the thumbnail image of a product on a category page. The small <img> I am clicking on are swatch images for the different colors of a product. I can get it to work usi...

How to convert an HTML table to JSON and use the JSON with JSON.NET?

I'm asking this question because I think it's one that we run into from time to time. I needed to take an HTML table that had been manipulated client side and send the resulting table data to the server for processing. Additionally, I wanted to map this using JSON.NET directly to my business object(s). ...

jQuery Syntax Question, pretty easy I think..

Hi all, question: <script type="text/javascript"> $(document).ready(function() { $(".module .caption").hide(); $(".module").hover(function() { $(this).find(".caption").slideDown(); },function() { $(this).find(".caption").slideUp(); }); }); </script> This snippet works great for my purposes, the only caveat is...

How to disabled the input,textarea,select using this code..

Hello friends I am using this code in my view.. Using this code I am disabling the fields when the view loads.. like this my view displyas for number of users which I am going to selct using this below code I am able to disable only first Fiedset not for other fieldsets? why its happening? I need to disable for how many users I select....

aggregate form elements into object ? [Solved]

hey all i am trying to aggregate form elements into object and then send it via ajax here is the code that i start using but i cant figure out how to do the rest $('.jcart').live('submit', function() { }); Update 1: html form http://pasite.org/code/572 Update 2: I have successfully submit the form using ajax but it still refres...

failsafe jQuery code

Can anyone explain what the jquery documentation is exactly referring to with this statement: "the argument to write failsafe jQuery code using the $ alias, without relying on the global alias" when referring to using the following: jQuery(function($) { }); I have been using jquery for a while now so understand what this code is ...

Except the input check box i need to disable all other input using jquery

$('fieldset').not('#Pchk input[type=checkbox]').find("input,select,textarea").attr('disabled','disabled'); Pchk is the id of my input checkbox and even i did this code to its not working out for me.. $('fieldset').not(':checkbox').find("input,select,textarea").attr('disabled','disabled'); if I use this code its disabling even my c...

.post inside jQuery.validator.addMethod always returns false :(

Hello! I am very new to jQuery and javascript programming. I have a program below that checks whether username is taken or not. For now, the PHP script always returns if(isset($_POST["username"]) )//&& isset($_POST["checking"])) { $xml="<register><message>Available</message></register>"; echo $xml; } Login f...

jQuery: Get one of a set of selected elements

There are several elements that are selected by $(".foo"). $(".foo").text() returns the text of each element concatenated together. I just want the text of one element. What is the best way to do this? $(".foo")[0].text() fails. UPDATE: I meant the . class selector, not #. Corrected. ...

FBML + jquery Validation + Rails

Hi all, In my local machine i have a scaffold that uses Jquery Validation plugin for the field's validation. Now i want to add that to a fbml facebook application, but i'm haven't been able to load the jquery javascript and the jquery Validation plugin into the app, does anybody now how to do that? or maybe someone could suggest me a ...