jquery

Jquery Ajax to [WebMethod]

Hi all, I'm posting the following to an asp.net [Webmethod] using jquery via the $.ajax method. I've trapped the data being sent over the wire. {number:01502,numberTypeId:2,companyId:531} I've break pointed inside the [Webmethod] and the number is being returned as 1502 even though the parameter type is string, I'm guessing this has s...

How can I get the elements without a particular attribute by jQuery

I know how to get elements with a particular attribute: $("#para [attr_all]") But how can I get the elements WITHOUT a particular attribute? I try $("#para :not([attr_all])") But it doesn't work. What is the correct way to do this? Let me give an example. $("#para [optional]") <--- give me the fname elem...

Does jQuery or JavaScript have the concept of classes and objects?

I found the following code somewhere, but I am not understanding the code properly. ArticleVote.submitVote('no');return false; Is ArticleVote a class and submitVote() a function of that class? Or what does the above code mean? And is there any concept of classes and objects in jQuery or in traditional JavaScript? How to create them?...

How to I hide and show HTML elements using JQuery?

How to I hide and show HTML elements using JQuery without any special effects? ...

Adding validations via submit button

Hi, I am using Cakephp and JQuery in my application. I have created the form using <?php echo $form->create('Result',array('action'=>"submit/$formid")); foreach ($viewfields as $r): echo $form->input($r['Attribute']['label'], array('id'=>$r['Attribute']['id'],'name'=>$r['Attribute']['label'],'type'=>'text')); endforeach; e...

jQuery how to reinitialize a delay function

I am using a Jquery time delayed fader like below, but need to reinitialize it based upon events in the code, ie knock the timer back to zero. How do I do this? I've tried just calling fader() again. function fader(){ $(ajdiv).delay(10000, function(){$(ajdiv).fadeOut()}); } jQuery.fn.delay = function(time,func){ //run a delayed funct...

jquery not working after getting a content from div

Hi friends, I have created a page, in that - after loading a content the jquery is not working properly. Problem : Initially i have a div "content" which having some text by clicking a button some content will load into the div "content" from div "temp" using $("#content").html($("#temp").html()) After loading this content the functi...

Jquery and click event.

I have the following code, the elements are added to the page, but unusually the click event never fires. Any ideas? function ToggleData(e){ var parentRow = $(this).parent().parent(); var rowData = $(':nth-child(2)',parentRow); var html = $("<input type='text' id='amendedval' value='" + $.trim(rowData.text()) +"'/>"); //Add the upda...

Refresh PartialView via jQuery following Ajax Post

Does anyone have the special sauce for following a jQuery Form ajax post to a controller method forcing a refresh to a PartialView existing on the same page? Does that involve bringing partial HTML back and appending or can I simply somehow cause that PartialView to refresh magically? Thanks in advance. Doug Here is my RenderPartial w...

How to capture submit form response "different domain"?

I have a case where i want to submit a form and get the response from this submit, because based on this response "at least submit complete response" i will make some other logic. What makes my case is different that this form is on a domain and i am submitting it to another domain name so can't use ajax submit due to cross script secur...

Form builder like Zend_Form_Html or ExtJS Form for JQuery

I was wondering if there is a JavaScript based HTML Form builder, similar to what you can do with Zend_Form_Html or with the ExtJS Forms but based on JQuery? There are several form related plugins but you still have to code every form manually. The idea is, that I usually only want to edit/add single entities from my Domain Model (e.g. i...

jQuery: Pass variable to :eq() does not work

I have been trying to find out why the following lines of code do not work: $('#add-cloud > select').change(function() { var selected = parseInt($('#add-cloud select option:selected').val()); $("#cloud-calculator table tr:eq(selected)").css("color", "red"); }); If I change :eq(selected) to :eq(4) for example - works fine. How do...

scroll elements down in jquery

Hi, I'm building a basic forum where each post contains a name, a message and a date. The forum is written in PHP and updates with AJAX to load new posts on the fly. When new posts come in, I would like the old posts to ease down nicely (much like facebook does today when you have new updates) and to make room for the new posts. Can any...

jquery validation remove submitHandler

Is there any way to remove the submitHandler or invalidHandler once they are set? If I submit my form and cancel out of my confirmation modal window, my other buttons are inheriting those handlers and not doing what they are suppose to do. I've tried unbinding the form submit at various places. As well as trying to redefine the validat...

jQuery add HTML table column

Hello, I have a HTML table like this: <table border="1"> <tbody> <tr> <td><a href="#" class="delete">DELETE ROW</a>COL 1</td> <td><a href="#" class="delete">DELETE COL</a>COL 2</td> <td><a href="#" class="delete">DELETE COL</a>COL 3</td> <td><a href="#" class="delete">DELETE CO...

Help understanding jQuery button enable/disable code

I grabbed this code form JCarousel and just trying to understand these lines below. I'm new to jQuery and not that great at JavaScript so I am not sure what is jQuery and which is JavaScript below this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent, this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarouse...

jquery class inheritance

var A=function(){ }; $.extend(A.prototype, { init:function(){ alert('A init'); } }); var B=function(){ }; $.extend(B.prototype,A.prototype,{ init:function(){ alert('B init'); } }); var p=new A(); p.init(); var x=new B(); x.init(); is the above the best way to create class and inheritance in jQuery? In B's init how do I invok...

Writing images out?

is the following writing images? If so, where is it placing it in the DOM? for(var j = 0; j < portfolio_itemList[i-1].url.length; j++) { $('<img>').attr('src', portfolio_itemList[i-1].url[j]); } Don't you need to specify a function to tell it to write the image? I am just trying to figure out what that line is d...

jquery text input length control

the text input only allows three words separated by spaces, and if it exceeds 3, the user can't input anymore, is this possible using jQuery? I can use keyup event to listen, but how do I stop user from typing in more tokens without using disabled. This is sort of similar to the native maxlength property for the text input in html except...

Difference Between $.getJSON() and $.ajax() in jQuery

I am calling an ASP.NET MVC action public JsonResult GetPatient(string patientID) { ... from JavaScript using jQuery. The following call works $.getJSON( '/Services/GetPatient', { patientID: "1" }, function(jsonData) { alert(jsonData); }); whereas this one does not. $.ajax({ type: 'POST', url: '/Services/GetPatient', data:...