javascript

Selecting a radio button when a dropdown value changes

My setup is something like this: radiobutton1 - selection1 radiobutton2 - selection2 textinput1 I want radiobutton1 to be selected whenever selection1 is changed, and I want radiobutton2 to be selected whenever either selection2 or textinput1 is changed. There has to be a simple javascript solution here... I just can't find it. Here...

Javascript sorting listbox works unless in a table IE8

I have a function that, when the user selects one or more items, it moves those items to the top of the list box (still selected) and scrolls to the top so they're visible. It works in all major browsers that I've tested. The problem comes when I have this function sort a listbox inside of a table cell. When I do that and use IE8, it ...

Reset element color to default stylesheet color (Jquery, Javascript)

I need to be able to reset an input field back to its original color after it has been possibly changed via javascript to a different value. The problem is I do not want to hard code the value obviously in case the stylesheet changes. I would like to use the default color used on the page. Is resetting the color like this fine, or is t...

getting value of another tag

In the below code onclick edit how can the value of tag test be obtained in the edit function. <script> function edit(a) { } var a= <tr class="clickable"><td id="userval" BGCOLOR="#FF6699"><label id="test">' + a + '</lable>&nbsp;&nbsp;&nbsp; <IMG SRC="edit.gif" onclick="javascript:edit(test.value);" > ></td></tr> </script> Than...

jslint: why do this code result in a "Strict violation" error message?

Running the following simple code results in a "Strict violation." error message. I have been trying to find documentation on why, and how to fix it. Any input will be much appreciated. The error: Error: Problem at line 6 character 4: Strict violation. } (this)); The sample code: /*jslint browser: true, onevar: true, undef: true, ...

GWT Table that supports dynamic filtering

This question is similar to http://stackoverflow.com/questions/161686/gwt-table-that-supports-sorting-scrolling-and-filtering However I would prefer open source and I am looking for snappy performance. I want a good way to perform dynamic filtering on rows. SmartGWT's adaptive filter looks interesting. http://www.smartclient.com/smartg...

Pass parameter as text to JavaScript function from .NET code-behind

Basically, I have a gridview that is opened in a new window from the parent window. It has a bunch of records with a view button to view the details of each record (which stays in the same newly opened window). I have a calendar in the parent window that accepts a Date querystring parameter to set the current date on the calendar at page...

Show / Hiding Divs

After cobbling together a few questions I've managed to get this far to showing / hiding divs: $(document).ready(function(){ $('.box').hide(); $('#categories').onMouseOver(function() { $('.box').hide(); $('#div' + $(this).val()).show(); }); }); HTML: <div id="categories"> <div id="btn-top20"><a href="">Top 20 Villas</a><...

Firefox DOMContentLoaded event problem

Hi, i've created a script that works with the Dom so it has to wait until the Dom is ready before execute every operation. I want that this script can be included in two ways: In the head tag so that it is loaded before the Dom is ready. I've used document.addEventListener("DOMContentLoaded",function(){...},false) for this and it works...

setting a value through jquery

<script> function edit(elem) { var ele=$(elem).siblings('label#test').html(); var a=document.getElementById('test'); var htm = '<input type="text" name="modal" id="modal" style="width:70%;" value="'+$(elem).siblings('label#test').html();+'"/>'; $dialog.html(htm) .dialog({ autoOpen: true, position: 'center' , ...

Getting javascript mouse position relative to website prefferably without jQuery

I've found this snippet on Ajaxian, but I can't seem to use the cursor.y (or cursor.x) as a variable and when the function is called as such it does not seem to work. Is there a syntax problem or something else? function getPosition(e) { e = e || window.event; var cursor = {x:0, y:0}; if (e.pageX || e.pageY) { cursor.x...

Opera IME support

Hi, i am currently trying to get Input Mode Editor (IME) support working with a designMode enabled IFrame. The problem here is with Opera it seems I don't get any useful notifications from the IME. It seems I get a single keydown with a keycode of 197 if the first time the IME is used - and nothing else ever again (No keycode 229 messa...

Problem reading element attributes with jQuery in IE7

I swear the following code used to work, even in IE7 but now i get Error: Object doesn't support this property or method $('div').each(function() { if(! this.attr('id').startsWith('light') ) { this.css('zIndex', zIndexNumber); zIndexNumber -= 10; } }); Any ideas? SOLUTION $('div').each(function() { va...

dropdowllist selected item from javascript to servlet

Is it possible to get the value from a JavaScript variable and use this value in a Java Servlet? I have read up on this but all I have found is getting the JavaScript value through a form submit. What I need is: I have a html select combo box. I need to extract the selected value from this and use this value to query a database. Is ...

Detect focus on browser address bar?

Is there a way to detect when focus has been put onto the address-bar or the browser-search-bar? I ask because I am trying to keep focus on one element in my document, but adding a blur() listener to that element (which calls focus() on that same element) works too well in Safari Mac -- you can't put focus on the address-bar when you se...

Reactive Extensions for Javascript code examples

Microsoft have published Reactive Extensions for Javascript. It should make asynchronous (and event based) web-ui programming easy. There are currently a video and some tutorials. But how cool UI could I really make? Do you know any good demos or code examples using rx.js? ...

Javascript "Member not found" error in IE8

I'm trying to debug the following block of Javascript code to see what the issue is. I'm getting an error that says "Member not found" on the line constructor = function() { in the extend:function() method. I'm not very good with Javascript, and I didn't write this, so I'm kind of lost on what the issue is. The error only occurs in IE8,...

How can I make a web-based "table" select like a spreadsheet? (rectangular area vs row-wrap selection)

I want to make a table that displays on a webpage, but one requirement is to make it easy to copy and paste into a spreadsheet. Normal HTML tables selection behavior is obviously different from how a spreadsheet like Excel selects -- when you select multiple rows it wraps around instead of selecting a rectangular area. Is there any way...

MS Dynamic CRM 4.0 serviceappointment closed state javascript event

Hi, I need to do the following: In Crm, you have serviceappointments (serviceactivities). 1 appointment can have a state, ( like arrived, pending, closed, ... ). When i save the form (onsave event), It should catch if the form is putted closed state and then it should do something. I can get the state easily: alert(crmForm.all.statu...

qx.data.store.Jsonp: configureRequest not getting request as parameter

when creating an new qx.data.store.Jsonp object like this... var store = new qx.data.store.Jsonp(url, { configureRequest: function(req) { req.setParameter("key", "resources.appsrvs"); } },"callback"); ... the delegate function configureRequest does not get the request as parameter as described in qx.data.storeInterface.IStoreD...