jquery

jQuery basic help

I'm sure I'm going to lose some rep points for this, because it's such a basic question, but I can't figure out what I'm doing wrong with jQuery selectors using "#" to select by id. given this element in my document: <%= Html.CheckBox("IsAlwaysValid", true, new { onchange = "showHideValidSetList()", id = "IsAlway...

Two or more action buttons on an MVC form - Best practice

I have an ASP.NET MVC app with a form. Say this form has an arbitrary number of buttons, each with their own action. <input type="button" id="action1" value="One" /> <input type="button" id="action2" value="Two" /> ... and so forth We want the user to click on one and have a jQuery action fire to submit the form and then repost the...

MVC ActionMethod not finding passed in Value

Hi, I have a Create ActionMethod, something along the lines of: [AcceptVerbs(HttpVerbs.Post)] public ActionMethod Create(Journey journey) { if (Request.IsAjaxRequest()) { //Save values return Json(new { JourneyID = journey.JourneyID } ); } } The Journey object that I pass in is from my LINQ2SQL datamodel. I call the ab...

how to get value of checked element in for loop

Hi I am working to get each value of the checked element and post them to php. But it only gets first value of just one checked item. here is $("#conf").click(function(){ var count = $("input:checked").length; for(i = 0; i < count; i++) { a = $("input:checked").val(); $.post("reqs.php?act=confirm", { ID: a }, fu...

How can I position an element next to user text selection?

I need to position an absolute positioned button next to user's selected text. just like what IE8 does internally. I'm binding a jquery event mouseup to the Document, and get the selected text. but I'm currently out of ideas how to know where the actual selection is positioned, without wrapping it in some element, because selection of ...

jQuery higlighting special characters in text

Hello all, I am using JavaScript text higlighting jQuery plugin http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html It works well for me all the time, except for some symbols: $("#preview").highlight($(this).val(), { wordsOnly: true, className: 'blacklist'}); if "$(this).val...

jquery drop shadow plugin?

Is there any drop shadow plugin for jquery? Seems there was but is no more... Any help? ALSO, is it possible to use jquery in a PHP file ? (I create a table in the php file) Thanx ...

How to use jquery in php file?

I am currently creating a table with php and data from a mysql db... So I need to use Jquery in the table.... How can I do this? Im guessing I have to import the library somehow? Thanks ...

create an array from similarly named id's

I have a group of id's with similar names (ex: div1, div2, div3) that are all going to perform the same function. is there an easy way in jQuery to create an array by calling the prefix of the id ("div")? ...

Form calculator using Each() and Children() in jQuery

Im trying to build a form that calculates a total price based on a series of drop down boxes with string values such as "This option costs £30" i know this is not ideal but im putting this together as a hack for an existing script For the most part ive got it working however im not sure how to run the each function for each child of #pr...

How can I move TinyMCE's toolbar into a modal popup?

I'm using TinyMCE & jQuery and am having a problem moving TinyMCE's external toolbar to another location in the DOM. To further complicate things, there are multiple TinyMCE instances on the page. I only want the toolbar for the one that's currently being edited. Here's some sample code: $(textarea).tinymce({ setup: function(ed) {s...

How can I keep a jQuery dialog on the screen?

I don't want to have the dialog centered on the screen so I'm setting the top and left coordinates of the box. I'm positioning it so that it appears next to a link and won't initially be open until a click. $("#error").dialog({ bgiframe: true, autoOpen: false, width: 'auto', height: 'auto', hide: 'slide', show: 'clip' }); and ...

jQuery conflicting hover/toggle states in IE?

Here's my code: <!doctype html> <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; <style type="text/css"> label {display:block; width:300px; height:20px;} label.selected{background-color:#a33;} label.hover{background-color:#ccc;} </style> </h...

document.ready() analog for $(html)/$.ajax

I use jQuery to attach some plugins in the $(document).ready() handler - for example, $(".date").datepicker(). However, when I load content using $("...html..."), for example from $.ajax(.., success(data){}), or from ajaxForm({target:...}), document.ready() is obviously not called. UPDATE: as pointed out it is called but still I don't kn...

Setting Tab Order on UI Elements in jQuery Dialog

Is there a way to specify the tab order of the elements within a jQuery Dialog which itself contains an Accordion? The dialog also specifies one button in the buttons options. For accessibility, we need to be able to tab through the accordion panes, the form elements in each accordion, the button in the buttons options, and the close ico...

Drag a zoomed image within a div clipping mask using jQuery draggable?

I'm creating an interface to allow a user to zoom in on an image and drag the zoomed version around within a clipping mask div. I have a div 200px by 200px that I set overflow: hidden on. Then I load a std img (<img src="etc">) into the div that is, say, 1000px by 1000px. Then I use jQuery $("#my-image").draggable({ containment: [-8...

Show busy gif after user clicks on a Link

I have a large excel document that is generated when the user clicks on the download link. When the download link is clicked the browser pops up the standard open save cancel dialog. The problem is that the wait time can be really long e.g. 15 seconds or more before the dialog appears. I want to show a busy gif while the request is in pr...

Jquery photo comparison

There's a jQuery plugin out there that puts a dragable bar that lets you pull it to the left or right to show one image or another. You can keep it in the middle to see half of each photo. It's not a "slider". It's great for showing how something has been altered or photoshoped. Is anyone aware of this plugin and know where I can find it...

jQuery: extending, adding a new function and building a plug-in?

Today, my only pressing question about jQuery is about the when to use jQuery.extend() and, jQuery.fn (which is used for plug-ins). Basil Goldman seems to have an explanation in “Defining your own functions in jQuery” but for some reason I’m still not satisfied that I have the best information. Once we start to work with jQuery.fn we mus...

JQuery not working at all in Opera

I've encountered a puzzling problem: JQuery completely breaks in Opera. I have current versions of both (JQuery 1.3, Opera 9.27). My website uses JQuery cycle, an animated slide show plug in, shown in this page: http://www.donotbendinc.com/index.php/projects/detail/ultrinsic/ It also uses Opacity, which makes images dim on Rollover:...