jquery

jQuery find and replace text in a variable

Hello, I have a variable like var theUrl = 'http://www.google.com/?q=%s'; then i have a input box like <input type="text" id="searchBox" value="" /> and a button like <input type="button" id="searchButton" value="Search" /> when the button is clicked, i should get a alert where the %s of the var theUrl should be replaced with t...

jQuery element variable doesn't seem to be accessible?

So I get a set of form elements that I want to extract the values from, by using var inputs = $("input.row_2"); inputs[0].val() When I run this, I get told that val is not a valid method. What am I doing wrong? Should be an easy one.. Thanks! ...

jQuery Filtering Gridview Columns

I'm looking to have a click event for all columns but the last column of a GridView and then have a separate click event for the last column of the gridview (a DropDownList). I have the following right now but just can't seem to get it to exclude the last column: var _activeRow; $('.gridview-jquerify tr').filter(function() { retur...

Why aren't my dynamically-added form inputs posting?

I'm working on a form where I need to dynamically add inputs whenever the user clicks a "more widgets" button. There's a hidden div inside the form, and I append the inputs to it with jQuery, like this: $('div#newwidgetinputs').show().append(newInputs); They show up, are properly named, etc, but when I post the form, their contents ar...

Add a custom jquery validation method not connected to a field

Normally all validation methods is connected to a field, radiobuttons, dropdowns etc. In my case I would like to do a general custom validation that depends on many fields in my form. I dont want one field of them to become highlighted like a normal "required", i would rather just show a message in the errorcontainer. Is there a simp...

jQuery Drawing Plugin

Camarades, You'd know me identify good libraries (preferably in jQuery) to work with "Canvas" and drawings in javascript / html. I want to make my page more interesting, especially in some registries (registry of cars) and would like to draw a car and be able to go changing the number of wheels for example. Many thanks for any help. Su...

jquery, list div-box above by clicking a button.

hi, i've got 20 div-boxes in a list [ div 1 ] [ div 2 ] [ div 3 ] and so on. every divbox should contain a button to change position with another div. one for up, one for down. [ div 1 <+><->] [ div 2 <+><->] [ div 3 <+><->] when i press the <+> in divbox 3, the divbox#2 and #3 should change places.... like it would by add the ...

close jquery UI dialog when file download begins

I am using an ASP.Net MVC site that has a link to an ASP.Net WebForms page that performs the actual download. I would like my jquery ui dialog to close when the download starts. Is there a javascript/jquery event that I can use to accomplish this? I found an example with exactly what I want to do here, but since I'm using MVC instead of...

jQuery && Google Chrome

This script works perfectly in all the browsers, except Google Chrome. $(document).ready(function(){ $(".banners-anim img").each(function(){ var hover_width = $(this).width(); var hover_height = $(this).height(); var unhover_width = (hover_width - 30); $(this).width(unhover_width); var unhover...

Use jQuery to change a CSS value

If i have a background image defined as: #header { width: 100%; background: url(/Content/images/header.jpg) -0 0 no-repeat; } and i want to overwrite that after the page loads. Shouldn't this code work? $("#header").css('background-image', '/Content/images/aff/header_<%=affiliateID%>.jpg') EDIT: As stated, the script needs ...

With (or similar) statement in JQuery

Very simple question: I want to optimize the following jQuery code with maximum readability, optimal performance and minimum fuss (fuss = declaring new variables etc): $(".addthis_toolbox").append('<a class="addthis_button_delicious"></a>'); $(".addthis_toolbox").append('<a class="addthis_button_facebook"></a>'); $(".addthis_toolbox").a...

jQuery Button.click() event is triggered twice

Hello everyone I have the following problem with this code: <button id="delete">Remove items</button> $("#delete").button({ icons: { primary: 'ui-icon-trash' } }).click(function() { alert("Clicked"); }); If I click this button, the alert show up two times. It's not only with this specific button but with ...

Is there any way to access codeigniter language and config properties from included javascript files?

Good morning! I'm having great success so far with CodeIgniter. I'm new to PHP and web development in general, but I feel that CodeIgniter is giving me a leg up while I catch up on the basics. My question for today is this - I have been happily loading config and lang values from my views for a while now, and everything is working fine...

Fancybox iframe says that my YouTube href is undefined

Here is my HTML: <a class="video iframe" href="http://www.youtube.com/watch?v=Psk2Pq03rv0&amp;#38;fs=1"&gt;Arbitrary text</a> Here is the Fancybox javascript: <script type='text/javascript'> $(document).ready(function(){ $("a.video").fancybox({ 'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 'type' :...

jquery, sortable: sort elements by ids...

hi, i want to reorder the sortable-list by ids.... but with the effect of the "sortable-ui"-component. how could i reorder the elements?... :-/ its pretty hard. ...

Change file extension if browser is IE

Hi, I'm looking for the best solution to dynamically change some images extension (from .svg to .png) only if the browser is IE. I don't know what's the best solution : parse the html code with PHP use jQuery with something like $("img.svg2png").attr("src", ...); dealing with htaccess and rewrite rules other solution ? Thanks ! ...

Getting events on delete and paste in textbox jquery

I am using jquery on asp.net mvc. I have textbox on page and I hooked up handler for keyup event of textbox. When user deletes the text or pastes text into it, i do not get the handler called. Please help me how to handle this. EDIT: Also I want to get the value when user pastes the value using mouse. ...

The best way to deploy one site for two companies in ColdFusion?

My client has multiple companies; different names/logos etc, but all the content on the sites are identical with the exception of said names/logos. In a ColdFusion environment, what would be the best way for me to serve up identical content and swap out the logos/company names on the fly so I can keep everything in one spot? Is this a j...

Problem with onchange and jQuery val() and text()

i have an text area like this one which i write in it now now i want when onchange the textarea content appear in a pre i used <textarea id="content" onchange="perview();"></textarea> function perview() { var code = $("textarea#content").val(); $('#code-preview').html(code); } i think every thing is ok <pre id="code-preview"></p...

jQuery combobox with nested option values?

I'm trying to create a combobox with a set of nested option values, using flyouts for the sub-values. jQuery UI Autocomplete seems to be the way to go for a flat list of options, but how can I use it with nested options? If there's a better plugin to use, I'm open to it. ...