jquery

jquery selector needed to select next table from element

hi, I need a selector that basically starts at the element that I have clicked and finds the next item with a certain class on the page. See my example below: <table> <tr> <td>Blah blah blah</td> <td><p class="click">Fire jquery</p></td> </tr> </table> <table class="hidden"> <tr> <td>blah blah blah</td> <td>blah blah blah</td> </tr> </...

Validation with Ajax and MVC

I am looking at the best way to take advantage of the MVC validation while using Ajax and not having access to a class. On my masterpage it will contain a simple form (name, email, tel, comments) which I display in a overlay. As this is in the masterpage is available on any page, The masterpage never inherits a class like you would do w...

Getting an unique id from an element

Hi Had a good crack at this, quite a few articles around but I can't make sense of them. Any help appreciated. When I click 'slide-toggle', I need 'slickbox' to expand, but ONLY that instance of 'slickbox' within 'slide' (i.e. there is more than one slickbox element on the page). I have tried to use this to denote that it should only ...

Writing jQuery selector case-insensitive version

I'm using following line and I would like to make it case-insensitive: var matches = $(this).find('div > span > div#id_to_find[attributeName ^= "filter"]'); if (matches.length > 0) { } My question is that how can I make the selector ^= to be case-insensitive? Maybe changing to filter and then some regexp? ...

problem in writing a function in jquery

hey guys this is my raw javascript code : <script language="javascript" type="text/javascript" > function S2T(e) { document.comments.comment.value = document.comments.comment.value + e; } </SCRIPT> and i want to convert it to jquery function <script language="javascript" type="text/javascript" > $(document).ready(function...

jQuery and labels.

Further to my previous question, I have a jQuery event that I want to fire when the checkbox and the label itself is clicked. jsFiddle example here. My problem is that when I click the label, it doesn't fire the function. The checkbox works fine, as you can see. Is there anything more I can add? Or is this it? Thanks :) EDIT: co...

Passing variable value form js function to rails view (dynamic select)

Hi, I'm using Ryan's solution to add and remove nested model fields dynamically through JavaScript using jQuery. There are 4 models: client, c_person; project, p_person. And one-to-many associations: client has many c_people and project has many p_people (these are people from client side but they belongs to project). Hope it isn't to...

uncaught exception: cannot call methods on tabs prior to initialization; attempted to call method

Hi Friend, I am using jquery tabs in my project and code for it is written in a js file. This js file is used in a user control and in one place i m facing following error uncaught exception: cannot call methods on tabs prior to initialization; attempted to call method 'div.profile-panes > div' and on the other place the code is w...

Extending jquery Attribute selectors

Hello, i have an inline popup that shows a list of checkboxes and associated labels each in seperate span element. i want to add a text box where user can type to filter the values (user names) in the popup. i have following code $("#toEmpFilter").live("change", function () { var FilterVal = $(this).val(); $("i...

jquery ajax validate,success,append

hi, i have this working code index.php <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; <script type="text/javascript"> $(document).ready(function(){ $("form#submit").submit(function() { // we want to store the values from the form input box, then send v...

jQuery - Dynamic Selector, not sure why its not firing.

Below is a static example of me triggering the scroll event. It will alert the 'Dynamic Selector', the alert result in this case is: #WordPanel #AZ-List div div div.ui-jqgrid-bdiv (That's right its the same as the static select ive typed in the example below) $("#WordPanel #AZ-List div div div.ui-jqgrid-bdiv").scroll(function() { ...

IE Javascript error "Object doesn't support this property or method" within jQuery

Hi everyone, For some reason, I am getting the following Javascript error in Internet Explorer 8 on line 3156 of jquery.js (version 1.4.3, non-compressed version): Object doesn't support this property or method. No error occurs in Firefox and Google Chrome. This is the line the error occurs on: if ( (match = Expr.leftMatch[ type ].exe...

Fire function when div is scrolled to | jQuery

Is it possible that if a div is scrolled to, it should execute a function, like for example: Yes? No? ...

How to use jQuery prevAll() to select nearby text nodes?

I'm getting a text node (node.nodeType == 3) returned from the getSelection range, eg.: var selectionRange = selection.getRangeAt(0); var startContainer = selectionRange.startContainer; This startContainer usually is a text node, eg the following html: <p>Paragraph in <u>parag</u>raph.</p> Would result in the text node with text "r...

jQuery loop checkboxes and tick ones which id exists in an array of number

Hi, I'm working on a script which will get a JSON array of id's. Based on the results, I then loop over all the checkboxes on the page and check the boxes where the id exists in the JSON array. The checkboxes are named like so name="name[id]" id="name[id]" How do I loop the checkboxes and determine if the id (between [ and ] ) exists ...

Is it possible to delete elements completely using jquery?

I have got a list of elements that im trying to delete using the .remove() from jQuery.It does delete the elements while viewing the page on the browser but I was wondering if its possible to delete the elements in its entirety from the page? So when i open the file in an editor later on, those elements shouldn't appear. And one thing ...

Parsing JSON query (and xml)

I would need to parse some data that i get from JSON query. I get the data with $.getJSON(JSONquery, function(data){ $.each(data, function(i,item){ $('#output.... }); The data I get from it something like this (sorry its messy and longish): [{"name":"139930 blablabla","id":599,"contentobject_id":599,"main_node_id":565,"modified":...

jQuery nested $.getJSON not working

Hi guys, I am trying to retrieve some data from a database using jQuery's $.getJSON method to display in a table, but for each user who's info I get, I have to get the many related systems related to that user, which requires a second $.getJSON call nested in the first, which I have tried turning into a function, which seems to be work...

changing href attr in jQuery UI datepicker

Hi, I'm playing around with the UI datepicker widget and I noticed that when the calender is generated, all the dates are inside an anchor tag with href="#". is it possible to change the href to the dateText, or whatever i set the dateFormat to? ex: <a class="ui-state-default" href="#October-27-2010">27</a> Thanks in advance //update...

How to detect all change/click events of HTML select that still has focus?

How can I reliably detect all events that cause the the value of an HTML select to change, while that element still has the focus? For regular mouse input, either the click or change event works fine. For keyboard input (and for mouse input using the scroll wheel), however, the change event doesn't fire until focus is lost. I get around...