javascript

how to add cursor type on a table row using javascript???

var tbl = document.getElementById(TABLE_NAME); var nextRow = tbl.tBodies[0].rows.length; row.setAttribute('style', "cursor: pointer;"); This will add double click event on table row.right..!!!But i m facing problem in internet explorer.working perfect in all other browsers. For adding style i am handling this: enter code her...

JavaScript - Prototype

Hi experts, I am trying to get a better working knowledge of JavaScript. So, I have bought the book, "JavaScript the good parts" by Douglas Crockford. I am having difficulty grasping the Prototype at the moment. Everything below seems to work in my browser until I hit //PROTOTYPE Example. Can someone have a look at it to see why I ca...

How to check value of INPUT element on change?

I have an INPUT element of the TEXT type and I want to perform an action whenever the INPUT's value does not equal a default value. How do I do this? I've looking into jQuery's "change" event handler, but it only works for SELECT elements. Anyhow, here is what I want to do.. Example: <input type="text" name="test" value=\"Default..\" /...

Where does come the offset in Raphael javascript

I really like the Raphael Javascript library which is very useful for handling SVG with javascript. However there is an offset value which is added to the generated svg code that I don't understand. Does anybody know where does it come from and how to avoid it? Here is my JS code: var paper = Raphael("canvas", 510, 510); paper.clear()...

how to select all songs when i click playselected?

Hi how can i get all songs selected when i click playselected button without selecting any songs? </style> <script language=JavaScript> function checkall() { void(d=document); void(el=d.getElementsByName('song[]')); for(i=0;i<el.length;i++) void(el[i].checked=1) } function uncheckall() { void(d2=document); void(e2=d2.getElementsB...

[JavaScript]: How to define a variable as object type?

I am using following code to check whether a check box on my website page is checked or not. But there are several check boxes and I want to use this same function. I want to call this function from a Submit button click and pass the check box name as argument. It should than validate that check box. function CheckTermsAcceptance() { ...

Assigning variables to objects in JavaScript

Hey there, I am using the following method to basically create a JSON string. var saveData = {}; saveData.a = 2; saveData.c = 1; However the .a and .c don't cut it for what I need to do, I need to replace these with strings. So something like.. var name = 'wibble'; saveData.name = 2; This would get accessed with saveData.wibble ...

EXT JS toLayout on Viewport doesnt show anything...

After reading many example about adding new components in to existing container without reloading whole page I run in to small problem while combining tree and tabs inside Viewport component. What I'm trying to do is to register on click event to tree node and load in to content container new component, depending on node type it can be ...

Ideas on limit the text on textfield?

for example, I want the textfield input number only. my idea is when the user typing, it will call a javascript to check whether it is valid, if it is not valid, I delete the text which is just entered. But I think it is very complex to do so. Is there any simple way to do so? ...

Looking for html/flash/ajax uploader component with specific requirements

There is a number of Flash and AJAX based uploaders around. I need a file upload component for an existing form in an existinc application, so I have very specific requirements for it. Maybe somebody knows one off the top of their head and saves me a lot of research. I need a file upload component that has a progress bar and "upload" bu...

[PHP/JavaScript]: How to refresh a Captcha?

I am showing Captcha in this way: <img src="ReturnCaptcha2.php" alt="CAPTCHA" width="100" height="50"> I have a hyperlink named "Reload" near it. I want to recall that PHP file without refreshing my page. Probably, AJAX is involved in it. Please assist. ...

JS Vars - Adding

Hi I have two variables, 'a' and 'b' in my javascript, and i want to add them together - i assume this code: var a = 10; var b = 30 var varible = a + b; This, puts the two numbers next to eachother... any ideas why... the result should be 40? Thanks!! ...

jQuery select items which parents are not of a given class

hi. how can select all nodes with class "myClass" whose parent nodes don't have class "myClass". for example, i have following HTML: <div class="myContainer"> <div class="myClass" id="d1"> <div class="myClass" id="d2"></div> <div class="myClass" id="d4"></div> </div> <div class="myClass" id="d3"></div> </d...

Uniquely identify a function in JavaScript

Is there any way I can uniquely identify a function without giving it an expando property? I've been just using "toString()" to identify the function, but when two functions are identical, they conflict. The following sample code reproduces the problem. In my actual code, the key for the associative array "myfunctions" is built from oth...

Multiple select control for web

We need a special user control for our web application. It should ideally look and work exactly like typical <select> element but with additional feature that would allow user to select multiple choices. I imagine it like drop-down list of items with checkboxes. User can either select one and only item by clicking it (just like normal ...

Is javascripts access to a password fields value considered a security risk?

If it is good style and security to store passwords securely and properly, then shouldn't the same be for web pages that require a user to enter a password? consider this example <script> function copy() { var text = document.getElementsById('text'); var pass = document.getElementsById('pass'); text.value = pass.value; } ...

livequery - confirm()

I don't get why this confirm() call fires up even though i hit "no". Can you tell me what i'm doing wrong? $('.deleteButton').livequery('click',function(){ if(confirm('Are you sure?')){ return true; }else { return false; } return false; }); The HTML Markup: <a class=...

how to disable a image button that acts as submit button

I have a image button thats acts as a form submit button: <a href="#" onClick="submitComment('+[id]+'); return false;"><img class="submitcommentimg" id="submitcommentimg<?php echo $id; ?>" src="/images/check.png" alt="Comment!" border="0"></a> What is the best way to 'disable' it to prevent accidental double clicking. ...

How to set the unique id for element in the loop with Mootools?

Hi,i need to set the unique numeric rel attributes for anchor elements in table with class "tdresult". Im trying to set them in the loop, but im not very good at Javascript and probably don't undestood loops. $$('.tdresult').each(function(chooseClass) { var ellen=chooseClass.getElements('a').length; var eli=chooseClass.getEleme...

Need help modifying javascript snippet

Google optimizer includes the following snippet as part of their conversion code. Unfortunately, the CMS we're using automatically converts the single quotes to ASCII (& #39;). I'm a novice with JS, but my understanding is that single quotes and double quotes are basically interchangeable. However, it's not a straight swap as there are...