javascript

Possible to run a javascript function after postback using an asp.net button?

I am trying to implement a web page that will on an asp.net submit button click will go to the server to add a row to the SQL database table. After that, on that same page, I want to be able to display the columnID as an alert using javascript (this has to be javascript). Is this possible? Any help would be appreciated. ...

XSL + Java Script Issue ... Unable to call javascript function from xsl file

I am a newbie to XSL world and facing few issues with XSL <?xml version="1.0"?> <xsl:stylesheet xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="/"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt; <h...

PrototypeJS: Selecting visible elements

I am trying to formulate a selector to select a set of visible elements. Our application uses the Prototype JavaScript framework, version 1.6.0.3. The markup I'm working with is as follows: <ul> <li style="display:none;">1 Hidden</li> <li style="display:none;">2 Hidden</li> <li style="">3 Visible</li> <li style="display:none;">4 Hi...

How can I monitor the value of a hidden input element?

I have a SELECT element which adds its value to a hidden INPUT via Javascript every time an OPTION is clicked (along with a visual representation of each selection) and I'd like to be able to monitor changes for another Javascript function. For the sake of modularity, I can't integrate the second function into the first one. I would also...

How to limit choice field options based on another choice field in django admin

I have the following models: class Category(models.Model): name = models.CharField(max_length=40) class Item(models.Model): name = models.CharField(max_length=40) category = models.ForeignKey(Category) class Demo(models.Model): name = models.CharField(max_length=40) category = models.ForeignKey(Category) item =...

Do we have any Minifier Add-in for visual studio 2005/2008 ?

Do we have any Minifier Add-in for visual studio 2005..? that minifies various files inside visual studio. ...

html preloader

Hi, Are there any ways to do html preloader with jquery? Sorry, I can't find it. I mean show a small size image (loading image) when html is loading. Thanks for answers ...

Creating an Infragistics Edit Template using code

Hi, We currently use Infragistics grid and we don't bind our datasets until run time, and then setup the grid settings in code. This seems a bit long winded, but its the way our senior developer wants it done. I would like to look into using the edit template and I was wondering if there was a way of auto generating an edit template f...

Adding an anchor to generated URLs

Hi I have tried finding a simialr example and using that to answer my problem, but I can't seem to get it to work, so apologies if this sounds similar to other problems. Basically, I am using Terminal Four's Site Manager CMS system to build my websites. This tool allows you to generate navigation elements to use through out your site. ...

Javascript setTimeout without putting code into a string

When using setTimeout, you have to put the code you want to execute into a string: setTimeout('alert("foobar!");', 1000); However, I want to execute a function to which I have a reference in a variable. I want to be able to do this: var myGreatFunction = function() { alert("foobar!"); }; // ... setTimeout('myGreatFunction();', 1000);...

Add attributes to textbox using jquery

I am using asp.net MVC. I have control like <%= Html.TextBox("username") %> I want lost focus event to that control. So code like $(document).ready(function() { $("#username").Attributes.Add("onblur", "alert('losing focus');"); }) but it is not working, Ultimate goal is to check password & confirm password matches ...

Custom dropdown box using javascript ?

Can we write custom dropdown box using javascript,html,css. and also placing backgroung-image for that. any sample example ...

How to enumerate all ActiveX elements with WMI?

Is it possible to enumerate all (or just enabled) ActiveX elements (*.dll, *.ocx) with WMI script? Motivation: ActiveXHelper ...

Google Maps - Add two markers (directions)

Hi forum. Playing around with Google Maps these days, with some directions. I have a map that gets the directions and address (reverse-geocoding) when dragging and dropping the markers. If there is two nodes on the map (http://dev.korebogen.dk/gmap/) the script is working fine (click set directions) - but I need to add a click event s...

How do I display only two decimals in a textbox and still read 5 decimals?

Hi, I am using an ASP.NET GridView control with a TemplateColumn which has a TextBox in the ItemTemplate. I am binding the Text of the TextBox with the values from database. The database holds these values with five decimal points, and for the interface I would like to display only two decimals. The user can make changes to this grid....

Extending an ActiveXObject in javascript

I want to add some functionality track certain calls to ActiveX object methods in javascript. I usually create my activeX object like this: var tconn = new ActiveXObject("Tconnector"); I need to log every time the open method is called on tconn and all other instances of that activeX control. I cant modify tconn's prototype because i...

What's should setting an HTML textbox value to null do?

We have a JSON response which can contain null values (e.g. { myValue: null }) - we assign this value to a textbox on a form: (actually, we use JQuery, but this is equivalent var nullString = null; document.getElementById('myInput').value = nullString; If we assign this value to an HTML textbox value, the behaviour seems browser-depen...

jQuery validation field by range

How can I validate field by range? I use additional-methods, but i don't know how providing parametr with range to my validation method via HTML. Something of a <input type="text" class="rangeField" rel="[10, 20]" /> It's nice, if i can make a difference between integer and decimal in validation. ...

testing if javascript function exists

I need to test whether the value of a form's onsubmit is a function. The format is typically onsubmit="return valid();". Is there a way to tell if this is a function, and if it's callable? Using typeof just returns that it's a string, which doesn't help me much. EDIT: Of course, I understand that "return valid();" is a string. I've ...

How do I fix this calendar javascript code?

Can anyone help me fix the following javascript code? It is supposed to produce a calendar, but the first line is not right. Two problems that I can see: The 1. of april is not on a sunday, so it starts on the wrong day The line is too long, unless april of 2009 really has a first week containing 18 days I'd appreciate any help you...