javascript

Checkbox to Control Button Enabled Property - ASP.NET

Hi I would like to know how I can control the 'Enabled' property of a button based on the 'checked' value of a checkbox: <asp:CheckBox ID="chkEnableButton" runat="server" /> <asp:Button ID="btnLoadForm" runat="server" /> I can do this very easily on the server side - but I require this to be done on client side only, meaning JavaScri...

jQuery/Javascript Multiple Array Combinations

I have been trying to find a solution to this with no avail. The idea of what i'm trying to achieve is to be able to find all unique combinations of multiple lists. So, let's say I have 3 lists of checkboxes (but this is an unknown number in the real-life application), Colour, Size, Pack Size. The items in the list's will be unqiue. [0]...

Trying to find a (jquery?) popup date/time selector with callback to php

I have a large table with input boxes. Three columns of these are dates/times (in unix format). Im trying to find an easy to implement way of allowing the user to click on this box, being able to (graphically) select a date/time, and when done, sending the selection to a php script to make the physical changes of the data. (i can conve...

enabling a disabled submital image with javascript

I use the below to disable my submit image when it is clicked to prevent double clicking: <input class="real" name="freshness" value="" type="text" size="5" maxlength="6"/><a href="javascript:void(0)" onClick="submitComment('+[id]+'); this.onclick=null; return false;"><img class="submitcommentimg" id="submitcommentimg<?php echo $id; ?>"...

Using ajax to send GET to php file after change to input

I have a series of dynamically generated inputs that I need to have ajax update in a php file for me once the user clicks off of the input. I think I have the right code, but it's not working for reasons beyond my understanding. I'm a complete javascript/ajax noob, so be gentle. The js/ajax: <script type="text/javascript"> // Initial...

svg text element width

I'm working on some ecmascript/javascript for an svg file and need to get the width and height of a text element so I can resize a rectangle that surrounds it. In html I would be able to use the offsetWidth and offsetHeight attributes on the element but it appears that those properties are unavailable. Here's a fragment that I need to w...

How to get the jQuery $.ajax error response text?

Hi all, I am sending an error response to my jQuery. However I can not get the response text (in the example below this would be Gone to the beach) The only thing jQuery says is 'error'. See this example for details: php <? header('HTTP/1.1 500 Internal Server Error'); print "Gone to the beach" ?> jQuery $.ajax({ type: "post", da...

[jquery] e.which ENTER key enabled only if input field focus

Hello, I am using a e.which of jquery for running a function on press of ENTER, but I want this function to be called only if the particular input field is focused (where the cursor is blinking). My current jquery function. $(document).keyup(function(e) { if (e.which == 13) { var page = $("#userpage").val(); if(pa...

[jquery] e.which codes for CTRL + A and CTRL + E

Hello, Can anybody please tell me e.which codes for key press CTRL + A and CTRL + E. Also please tell me where i can find these values, i tried searching google but no appropriate results and i dont want shortcuts plugin for simple needs. Thank You. ...

Simple HTML sanitizer in Javascript

I'm looking for a simple HTML santizer written in JavaScript. It doesn't need to be 100% XSS secure. I'm implementing Markdown and the WMD Markdown editor (The SO master branch from github) on my website. The problem is that the HTML that is shown in the live preview isn't filtered, like it here on SO. I am looking for a simple/quick HT...

Imitate "onselectstart=return false" using CSS or other non-JS approach?

I have created a button CSS class that uses background images with different positions to display a different image on normal, mouseover, and click states. One thing completely destroying the visual effect is that if I click such a link repeatedly and move the mouse just a pixel, the link text gets selected. Is there a way to achieve ...

Iterating through/Parsing JSON Object via JavaScript

Hello, I'm having a problem with jQuery/Ajax/JSON. I'm using a jQuery ajax post like so... $.ajax({ type: "POST", dataType: "json", url: "someurl.com", data: "cmd="+escape(me.cmd)+"&q="+q+"&"+me.args, success: function(objJSON){ blah blah... } }); It's my understanding that this will return a JavaScript JSON object? Th...

Problem with logical OR.

What's wrong with this code: if (Gender != "M" || Gender != "F") { alert("Please enter gender." + Gender); document.getElementById("gender").focus(); return false; } ...

jQuery change event on <select> not firing in IE

I've got a page with a variable number of <select> elements (which explains why I'm using event delegation here). When the user changes the selected option, I want to hide/show different content areas on the page. Here's the code I have: $(document).ready(function() { $('#container').change(function(e) { var changed = $(e.target);...

VS2008 SP1 Lost Javascript Colorization and Intellisense

Hi everyone, I'm hoping this is a simple fix. I'm using Visual Studio 2008 and recently had to install SQL Server 2008 enterprise edition on my local computer. One requirement was that Visual Studio 2008 SP1 needed to be installed, so I installed it. After that, SQL server installed just fine and I can now use it. However, now, I seem t...

Request-URI Too Large window.open - workaround

Hello All: I am opening a window and passing set of parameters to it. In this case, I am sending json string. At time, the info is toolarge, and Request-URI Too Large occurs. window.open('../pssops21/php/createPhonePdf.php?strSelectedItems=' + strSelectedItems + '&strQBNumbers=' + arrQBNumbers, 'mywindow', 'resizable=1, scro...

Best approach to slideup and tabs with jQuery

I'm creating a page with an image at the top, and a menu below. When the user clicks on on of the 3 menu buttons, the image slideUp and the page scrolls down so the menu is at the top of the page, then the right .content div fades in. The slideUp should only happen the first time the user clicks on of the buttons. What the absolute best...

prettify will cause "script is busy" warning if the code is long

I'm using prettify by Google. How to fix? ...

What makes IE6 not accept text in input boxes?

I have 2 input boxes that are not disabled. When either gets focus no cursor is displayed and any text that you type in is not displayed. There are several events attached to these elements, but there are no js errors. Expected behavior occurs in IE7, IE8, FF2, FF3, Chrome, and Safari. EDIT: Here is a code example of the events being at...

JQuery: Toggle question

How do you fire a JQuery toggled event once, and only once, another JQuery toggled event has been completed? I have the following: I have <div id="displayDivWhenPageLoads">...</div> - this DIV is show (visible) when the web page loads. I also have <div id="displayDivWhenToggledSelected">...</div> - this DIV is hidden (display:none) wh...