jquery

Why won't .attr('checked','checked') set?

I have the following snippet of code (I'm using jQuery 1.4.2): $.post('/Ads/GetAdStatsRow/', { 'ad_id': id }, function(result) { $('#edit_ads_form tbody').prepend(result); $(result).find('td.select-ad input').attr('checked','checked').click(); }); Assume that the post works correctly and returns a correct pre-built <tr> with s...

jQuery Validate: Checked *or* Filled?

required( dependency-expression ) They give an example of required: "#other:checked" but I want my field to be required if the #other field is either :checked or :filled (I don't know whether it will be a checkbox, radio button, or textbox beforehand). How would I do this? ...

Help with mysql sum and group query and managing results for jquery graph.

I have a system I am trying to design that will retrieve information from a database, so that it can be plotted in a jquery graph. I need to retrieve the information and somehow put it in the necessary coordinates format (for example two coordinates var d = [[1269417600000, 10],[1269504000000, 15]];). My table that I am selecting from i...

jQuery: strip domain name from url (string)

hi all, i'm accessing the stylesheet collection like this: var css = document.styleSheets[0]; it returns eg. http://www.mydomain.com/css/main.css question: how can i strip the domain name to just get /css/main.css ? thx ...

How to fixed each column width in jgGrid ?

colModel:[{name:'SalesNumber', index:'SalesNumber', key:true, width:150}, {name:'Customer', index:'Customer', width:150}, {name:'Title', index:'Title', width:150}, {name:'AssignedDate', index:'AssignedDate', width:100}, {name:'FollowUpDate', index:'FollowUpDate', width:100}, {name:'BusinessUnit', index:'BusinessUnit', width:100}, {name:'...

JQuery: $(window).resize() doesn't work on Load

I noticed that the following JQuery code doesn't run on the page load, but instead, it only runs after the page loads and I change the size of my browser window. $(window).resize(function() { ... // dynamically set the height of some div based on the browser viewpoint height }); Question: How do I get the code above to also run when...

JQuery: Tabs - How do you know when a tab has been clicked?

I'm using the JQuery Tabs. I want to fire a function of mine when the user clicks on a particular tab. How do I bind an event to each individual JQuery Tab when clicked? ...

Cleanest way to tell if 3 times are within half an hour of each other

I have 3 date / time input boxes on a form and the user cannot select any times within half an hour of each other. I've converted all values to epoch format using a Javascript implementation of strtotime, but not sure how to recursively check that any of the times are actually half an hour apart. I can hand code all checks, but it woul...

Trying to convert JQuery to Mootools - show hide using mouseenter and mouseleave

I am trying to port the code below to mootools 1.1 code but am having no luck jQuery(document).ready( function(){ jQuery("div#fpss-nav_activator").bind("mouseenter",function(){ jQuery("div#navi-outer").stop(true, true).show("slow"); }).bind("mouseleave",function(){ jQuery("div#navi-outer").stop(true, true).hide("slow"); ...

Do jQuery and JavaScript have different namespaces?

I have this code in jQuery.. $(document).ready(function(){ var fieldCounter = 0; ... I have a jQuery function that increments this value. This works, but I can't access this value on the page from a non-jQuery function? The reverse is also true, if I scope it in JavaScript e.g. <script type="text/javascript"> var fieldCounter = ...

Populating array of input fields as alternate fields using jQuery UI datepicker

I am using jquery ui datepicker in order to populate start and end dates for multiple events on the same page, the number of events is dynamic and I need to post day, month and year as separate fields, so I have something like this: <input type="text" name="event[0].startDate" class="date"/> <input type="hidden" name="event[0].startDate...

jquery control execution of the callback functions

Function socialbookmarksTableData(data) is called by another function to generate the content of a table -- data is a JSON object. Inside the function i call 2 other functions that use getJSON and POST (with json as a return object) to get some data. The problem is: though the functions execute correctly i get undefined value for the 2 v...

How do I put a <div> box around my cursor on click?

I am trying re-create the facebook tagging functionality, where you click on an image and the part of the image you click on displays an empty box (or a square). Using jQuery, how do I make the box appear around my cursor on the click? Thanks ...

Asp.net button click populate Autocomplete for a textbox

Hi All, I have created a keyboard using asp:button control. Onclientclick event it will display the corresponding text on the textbox. All these are working fine. Needs: I want to add autocomplete using jquery to a textbox. if i click the button [A] it has to display all the records with a. This process is working if im using the s...

Help with jQuery BBQ Plugin

Hi I´m working with a form and want to use jQuery BBQ Plugin for saving history records for the user. The form is divided in two divs like this: <div id="step-1"> <form> some inputs... <input type="button" id="next" value="Next &raquo;"/> </form> </div> <div id="step-2"> <form> some more inputs... <input type="submit" id="submit" value=...

jQuery each function, getting the data out of it

I am trying to use the jQuery each function (line 5) to display the results of an AJAX call. when I write resultObj.value on line 6 how come I am not getting any data? Am I making a syntax error (I am pretty sure that I must be)? success : function(resultObj) { count = count+1; $(".objHolder").filter("#"+id).append("<table border='1' c...

Captcha loading problem in popup

I am using jquery.load() to load a page on click of a button. The page that will be loaded contains a captcha. When that page is getting loaded due to the captcha it is making the page to reload again and it is not showing anything. If i am removing the captcha from the load page it is working fine. I am using ASP.NET. Can anyone help me...

Plugin for making marquee like text using jquery

Hi everyone... In the process of making an old webpage standard compliant, the validator came across a marquee tag... and screamed bloody hell.... Is there any good jquery plugin to achieve the same effect as the marquee tag...? I googled around a bit and found a couple but both involved enhancing the animation of the marquee tag... A...

jQuery not loading on Master Page when the Content Page is in a child folder.

I have a site where I am trying to implement a jQuery UI based MessageBox in my master page. Content pages are arranged accoring to business area folders, i.e. '~/Branding/Contracts.aspx'. I find that when I load such a content page, jQuery, which is referenced in the master page as below, does not load. I assume that this is because ...

Trigger action when element is clicked but not when some specific subelements are.

I have a div, containing text and a few links. I want to trigger an onclick event, only if the click occurs anywhere in the div, but not on any of the links. What would be the best way (performance wise) to implement this using jQuery? The one I use is $('#div').click(function(){ }); but it disables all the #div > a ...