jquery

Best option to use while generating a Field inside a Form on loading

Hi, i m having a doubt regarding which one is better option to use ? $("<input id="input1"></input>").appendTo("#Form"); OR using $('<?php echo $form->input();?>').appendTo("#Form"); ...

animate div background image

i have div <div class="hide1" id="MDive"> <TABLE WIDTH="1000" BORDER=0 CELLPADDING=0 CELLSPACING=0> in this div i have complete body of page. i have also two classes <style> .hide1 { background: url(bgs/bg_first.png) no-repeat; } .hide2 { background: url(bgs/Picture-12_SOFT.jpg) no-repeat; } </s...

How can I get the last selected value in a ListBox with jQuery?

Hi!! I have a listbox and I must limit its selection up to 5 items. If a 6th item is selected, I want to "deselect" it. But, I'm having some problems on finding the last selected item and "deselect" it. And the last item selected it's necessary the $("#mySelect option:last")... How can I get the selected item of a listbox?? Thanks!!!...

Help with calling an internal method of a jQuery plugin

I've written a plugin to highlight terms used to find a page. The source is also available. My problem is, if you look at the first link's inline JavaScript, I've made a custom textPlacement function to handle the insertion of the display bar (it looks a bit like Stack Overflow's). As you can see, I have an event handler on the button ...

JQuery Dialog not displaying imput type text

I have been trying to add a standard html :<imput type="text" value=""> into a JQuery dialog box, but it does not show up. I have tried with a selector and it was working. I don't understand why it doesn't with text imputs. ...

How do I know if a form has been modified

I Would like to know if there is anyway I can check if a form has been modified. eg. If one of the inputs has been changed I would like to display a button to submit the changes. ...

ASP.Net Charts - Obtaining via jQuery on IE 7 causes the image not to load

I am using the ASP.Net Charting Controls and ASP.Net MVC. I am trying to have a chart displayed on a page, the user can change various data associated with this chart and then press a button which will perform a POST operation and then return a newly rendered chart. This is refreshed via jQuery which loads a partial view containing th...

How can accept only number in input box

i have input box. i want to take only number in it even if user right click text and use mouse to paste. I do not want plugin..just jquery code i use keyup event but it no work if user enter any other character except digit, it should instantly replace with empty string ...

jquery writing an if

I have some code like this: if ($(event.target).is('.class1') || $(event.target).is('.blab') || $(event.target).is('.foo') || $(event.target).is('.cbncvbn') || $(event.target).is('.dfghdfgh') || $(event.target).is('.tryrty')) { // Do something } Is there a more succinct way to write this? PS: I know there are better ways to do t...

JQuery click function not being set

I want my links not to have the weird outline and the best way I found to solve this is have a "null link" to focus on after a click. This works great when defining the onclick method inline the HTML but that is not ideal. I wrote a quick jQuery snippet to do this instead, but I am having trouble getting it to work. Here it is: <scri...

jquery div background fadein

i have html page <body> <div class="hide1" style="width:1000px; height:1000px;"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" align="center">Heading</td> </tr> <tr> <td width="51%">Left1</td> <td width="49%">right 1 </td> </tr> <tr> <td>Left 2 </td> <td>right 2 </td> </tr> </table...

UI.tabs with Superfish menu

I'm using jquery.ui.tabs to create a carousel. On the same page is a superfish dropdown menu. Everytime I'm hovering over a menu item and the tabs switch, the menu closes if it's a submenu or flickers if it's a top-level menu. See http://demos.zatechcorp.com/mm/ for an example. How do I fix this? ...

detect paste on input box

I have inputbox. When page load, i use mouse to right click inputbox and choose paste from contextmenu. when text get pasted, which event to use to alert text instantly as soon as paste happens? i use "input paste" but not work in IE ...

jquery fadein stop

i have following script <script> $(document).ready(function(){ $("div.mover").hover(function () { $("div.hide1").fadeTo("slow", 0.33); $("div.hide1").fadeTo("slow", 1); },function(){ $("div.hide1").stop(); }); }); </script> and html page is <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><d...

Check file input size with jQuery

hey guys, I have a form with file upload capabilities and I would like to be able to have some nice client side error reporting if the file the user is trying to upload is too big, is there a way to check against file size with jQuery, either purely on the client or somehow posting the file back to the server to check? ...

Difference in jQuery with XML namespace and xhr.responseXML between Opera and Firefox

Consider this: <!DOCTYPE HTML> <html><head><title>XML-problem</title> <script src="jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('<p/>').load("text.xml", function(responseText, textStatus, xhr) { var xml = $(xhr.responseXML); var x_txt = xml.find('atom\\:x')...

jquery highlight effect with hide mode not working on IE

Hi I have a div to show a message, I want the message to appear for a few seconds and then just fade until it disappears. I just define a normal div and hide it when the page loads with $('#mydiv').hide(); I have a button to show the div with the desired effect, for this, I'm using: $('#myDiv').fadeIn('fast').effect("highlight", { ...

jQuery Click/Change event not working properly in IE7/8

I am binding an event to a checkbox's change or click event which works fine in Firefox but in IE I have to click anywhere else (causing the blur) event before the event is fired. I have read and believe this is down to the way IE fires the events, but is there anyway I can get round it?! The whole point is that it is a smooth search f...

jQuery: Selecting elements that don't have a specific descendant element

How would I select all table elements that do not have any descendant td elements using jQuery 1.3.2? ...

How to bind some function to non exist element?

My problem: after load some element via ajax, i bind some on-click function, but when user will load few times that same element, binded action will be repeat (not replace, at least that it looks like). I tried unbind, or click(function(){return false;}); but that complete remove clic action from element...). What is standard solution of...