javascript

How to enable form submit using onchange event?

Hi all! In my project I need to validate the form while using entered data to enable submit button only after the correct data have been entered. I hook onkeypressed, onclick, onblur and onchange events for input field, but none of that is fired when user pastes values using mouse into the field. Currently I use setInterval to periodica...

Most elegant way to implement animated "sliding panels"...

Hi, I'm attempting to implement a similar animated "sliding panels" effect as the Aveda website. I'm a little overwhelmed by all the options and Javascript libraries that are available. And a little confused after examining the Aveda website code. Any recommendations as to how to approach this task please? Which Javascript/Effects...

jquery removing string parts from two areas

I'm looking to expand on a recent script i've coded using jquery. I have this following code <script type='text/javascript'> added_departments = new Array(); $("#departments_submit").click(function(){ var depo = $("#depo_list").val(); if(jQuery.inArray(depo, added_departments) != -1) { return false; } else ...

how pass selected index value to a change function jquery

I have a select menu that looks like this: <select id ="cal-category-select"> <option value="/event-sort/list/2009/9/sports/">Sports Events</option> <option value="/event-sort/list/2009/9/fine-arts/">Fine Arts Events</option> ... </select> when the user selects an option from the select, I need to pass the option value att...

Regular expression in javascript to remove anything that is not: a-z 0-9 and hyphen

Hey all. Thanks in advance. I would like a regular expression that removes anything that is NOT alpha numeric and a hyphen. So allowed are A-Z 0-9 and -. Also, how could I apply that to a string in Javascript? Thanks again. ...

Scrollbars not appearing in new window

I'm trying to open a new window, and for some reason the scrollbars will not appear in Firefox or IE, but do work fine in Chrome & Opera. here's the javascript code on the button (from a PHP script), and below, if it's more readable, the HTML that is output: window.open('".BASE_URL."utils/viewProfile.php?key=".$key."',null,'width=1280...

Extract all links from a string.

I have a javascript variable containing the HTML source code of a page (not the source of the current page), I need to extract all links from this variable. Any clues as to what's the best way of doing this? Is it possible to create a DOM for the HTML in the variable and then walk that? ...

Javascript new RegExp(), reading patterns in from JSON

I'm trying to create a bbcode filtering solution that works with both PHP and Javascript. Right now I'm working on the javascript. I'm having trouble getting the new RegExp constructor to recognize the patterns in my json. Here's a small bit of sample code that reproduces the issue. Any insight would be greatly appreciated! bbcode.json ...

Ajax ActionLink OnSuccess call javascript function with parameters, Error: Object required

Hi all Using Ajax.ActionLink's OnSuccess-Event brings me some trouble. As asked here the function cannot be called directly. I tried all the suggestions I found, I get a message "Object required". The javascript-function expects an event, which is nothing/null when I pass it the correct way. Code snippets Before: OnSuccess = "ListA...

Javascript: Debuging code created by eval() and new Function()

Hi all, im trying for put a private var into an already existent function, example: var AObject={ get:function(s){ return s.toLowerCase()+a; } } function temp(){ var a="A"; var o={}; eval("o.get="+AObject.get.toString()); reurn o; } var bObject=temp(); BObject.get("B"); // "bA" BObject.get(); /* error...

Javascript Cookie Timeout With Countdown Timer

I want to set a cookie with javascript. Easy enough. Lets say I set it for 15 minutes. How would I make a count down timer show to show when the cookie expires? And even if they left the page I would want it to keep counting and when they come back to the page it would still have been counting down. Sorry for the poor explanation. But ...

ASP.Net Debugging, proxy path to seperate domain?

Right now I have a rather annoying framework that requires a set of php/asp pages and a CGI executable to run. This thing is annoying enough to set up (licensing server, persistent processes, IIS configuration hell, etc) that it isn't practical to setup a local IIS server. I am wondering if there is an easy way to proxy all requests of...

Getting Google Chrome to Ignore IE Javascript

I'm creating a slideshow using javascript that fades images. Awhile back, I discovered that to change the opacity of an image, I have to use a different API, depending on whether the page is viewed in Firefox or IE. Firefox: img.style.opacity = [value 0 to 1]; IE: img.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity= [...

JSON Iteration - My JSON object is being treated as a string literal?

This is probably a super easy question but I'm banging my head on it for some reason. Here is the jQuery I have $(function() { $.get(urlGetContainerNumbers, function(data) { console.log(data); for (var idx = 0; idx < data.length; idx++) { var containerNo = data[idx]; console.log(containerNo)...

Is there a public specification of WebGL anywhere?

It seems the Khronos group is fairly closed when it comes to releasing early specs for WebGL to the public. Does anyone know of a resource to keep up to date on API changes? The only thing I can seem to find, short of doing a checkout of Firefox or WebKit sources, is a page from 2007 on Vladimir Vukićević's blog with a small list of Op...

javascript changing the get parameter without redirecting

How can I just change the get parameter without redirecting? parent.location.search = "?after=20"; // ok that changes, but also redirect to the new page Any solution? Or answer is no, if its no, please write big no. ...

jQuery arrays and retrieve data and key

Hi all. I am new to jQuery and just wrote this small piece (with PHP knowledge) and was wondering a) would it work b) how would i return a value acording to its key value? var boxHeightArray = []; var boxNameArray = []; $("div[class=dropDiv]").each(function(i){ var height = $(this).height(true); var name = $(t...

C# .NET and Javascript Confirm

I have a C# ASP.NET web page with an xml file upload form. When the user clicks 'upload', a javascript confirm alert will pop up asking the user, "is this file correct?". The confirm alert will only activate if the file name does not contain a value from one of the other form fields. What is the best way to combine the use of a C# AS...

how to pass parameter to a javascript function using struts taglib?

Hi I have a javascript function updateHiddenField(value) that gets a value as parameter and then sets this value as the value of a hidden field. I have a JavaBean flight with parameters id and flightNo. Problem: How can I pass the parameter id of JavaBean flight to the js function updateHiddenField(value) when using <html:link> tag(s...

Opera Mobile 9.7 Beta Set Focus

We use a handheld scanner to move items in and out of inventory. The scanner runs an ASP page that submits the form to move the item. We recently purchased a new scanner running Windows Mobile 6.1 and soon realized that Mobile IE is completely useless. It does not render tables correctly and worse, it doesn't recognize onblur, onkeypress...