javascript

How can I remove RequiredField validation from a asp.NET button by using JavaScript?

Hi, What is the simplest way to remove -unbind- required field validation from a button which is added in asp.Net Page by using RequiredFieldValidator control on the client-side by using Javascript or jQuery functions? Thanks! ...

How to use Jquery for sliding effect

I am new to javascript and jquery. I have written some javascript code for some client validation. document.getElementById(spnError).style.display = 'block'; This is how I am showing a span if there is some validation issues in the form. I want to use Jquery to show this span. I would like to slide it down slowly. ...

Selecting the correct input field using jquery

I'm trying to select the id's of dynamic input fields in my code. When clicking a button, the form will create a form field like this: <td><input type="text" id="field_a_1"></td> <td><input type="text" id="field_b_1"></td> <td><input type="text" id="field_c_1"></td> When I click on the button again I get this: <td><input type="text" ...

What is Javascript collision?

Any best practices around it? ...

Automatically POST on document creation

In an HTML-document, i want to have a (if possible: invisible) form that POSTs the contents of one text input field to my server as soon as the document is created or if possible within s seconds. The document is created via javascript's open. How can i do that? ...

jQuery - I'm getting unexpected outputs from a basic math formula.

Hi I would like to start by saying I'd greatly appreciate anyones help on this. I have built a small caculator to calculate the amount a consumer can save annually on energy by installing a ground heat pump or solar panels. As far as I can tell the mathematical formulas are correct and my client verified this yesterday when I showed hi...

Progress Bar Filling - jQuery Implementation

I'm implementing my own Progress Bar using jQuery. My question is how can I fill (for example) only 30% of it with a background ? What are my options ? Basically, the Progress Bar is a simple div with rounded corners (-moz-border-radius). I'm using Firefox 3.6.3. [Update] I tried this example. How to force the right side of the filled a...

How to check if a Latitude/Longitude point is on the GRoute in Google Maps API?

I'm ploting a route between two points and I need to check if the route goes through a predefiend location. In the api, each GStep has a start and end points but the path doesn't have to be straight. Given a Lat/Long point, is there a way to check if it intersects with a route? ...

Load a Struts 2 action using jquery in javascript

Hi I'm using struts 2. I'm trying to reload a target div from a javascript by using jquery to target the div and a struts action that loads the content. Does anyone know how to do this? The problem is how I use (javascript) jquery to do this. BR, Tobias ...

What are jQuery best practices regarding Ajax convenience methods and error handling?

Let's suppose, for an example, that I want to partly clone Gmail's interface with jQuery Ajax and implement periodic auto-saving as well as sending. And in particular, let us suppose that I care about error handling, expecting network and other errors, and instead of just being optimistic I want sensible handling of different errors. If...

delete a row in html table using a hidden type and javascript

Hi, I have a table with HTML constructed using my servlet class. When trying to delete a row in this table using a javascript function I must first of all put different id to separate elements.and i resolove it with hidden type like that: retour.append("<td>"); retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\" val...

Abstracting the adding of click events to elements selected by class using jQuery

I'm slowly getting up to speed with jQuery and am starting to want to abstract my code. I'm running into problems trying to define click events at page load. In the code below, I'm trying to run through each div with the 'block' class and add events to some of its child elements by selecting them by class: <script language="javascript"...

How to use JavaScript to measure how bright a users monitor is ?

I've noticed that the brightness of computer monitors drastically varies between computers. As such, this changes the look of web pages greatly. Is there a way to use JavaScript to automatically detect how bright (or dark) a users monitor is so that I can adjust my web page colors accordingly? UPDATE Please note that I do not want ma...

javascript context menu in iframe

Hi, I have a problem with JQuery Context Menu ( link text ) and iframe. If i use it inside, the context menu is naturaly shown inside. But it will be partialy shown. I am searching how to resolve it. Please note that the context menu only appear when i click on specific iframe's elements. thanks :) ...

What are the benefits of a classical structure over a prototyple one?

I have only recently started programming significantly, and being completely self-taught, I unfortunately don't have the benefits of a detailed Computer science course. I've been reading a lot about JavaScript lately, and I'm trying to find the benefit in classes over the prototype nature of JavaScript. The question seems to be drawn dow...

JSF, Richfaces: How to run Javascript method each time rich:datatable (re)renders?

I have a rich:datatable which may be reRendered my multiple components in my page. I want to run a Javascript method each time it is rendered, including the first time the page loads. How can I do this? ...

Browser Client Side Storage aka a large Cookie

Hi, I need to store about 20-30k or data on the client side when using a website. I was using a cookie, but this is to small for my needs. Is there something else that I can use? I need to be able to do this via javascript. Server side storage is a last resort but not what I am looking for. I need it to work for Chrome, IE and fire...

Disable a form and all contained elements until an ajax query completes (or another solution to prevent multiple remote requests)

I have a search form with inputs and selects, and when any input/select is changed i run some js and then make an ajax query with jquery. I want to stop the user from making further changes to the form while the request is in progress, as at the moment they can initiate several remote searches at once, effectively causing a race between...

Disable certain input element with javascript enabled

How do I disable element so it will not submit when clicking on it (but make sure javascript events still work)? "Disabled" attribute turns javascript off. ...

in javascript how to find element is array ?

In javascript is there a good(i mean built in) way that i can find whether element if array of not ? one simple i can see is as follows but i don't like it if(ele.push){//its array it has push method :) } I mean i would like know if something like below if exists. typeof made me upset as its returning "object" (though that makes sense...