javascript

Should I check if the 'disabled' attribute exists before removing it?

I had a requirement where I need to clear off the "select all" checkbox in case user manually deselects any of the data rows. This has been accomplished by detecting this during an onRowSelect (jqgrid event) event. The code snippet is as below and works as expected. onSelectRow: function(){$("input:checkbox[id='cb_jqg']").removeAttr('ch...

how to validate this form in jquery

<form id="myForm" runat="server"> username <asp:TextBox ID="txtuser" runat="server"> </asp:TextBox> Password <asp:TextBox ID="txtpass" TextMode="Password" runat="server"> </asp:TextBox> <asp:Button ID="btnsubmit" Text="submit" runat="server" OnClientClick="Val()" /> </form> this is my source code anyone validate it or if anyone have a...

Forcing a DOM refresh in Internet explorer after javascript dom manipulation

Here is the situation. I have some javascript that looks like this: function onSubmit() { doSomeStuff(); someSpan.style.display="block"; otherSpan.style.display="none"; return doLongRunningOperation; } When I make this a form submit action, and run it from a non IE browser, it quickly swaps the two spans visibility and...

Can I generate proxy objects for WCF service library using scriptmanager?

I have used the AJAX Enabled WCF Service template from within a web application. By adding a Service reference to the scriptmanager, some client objects are generated allowing me to easily consume the service. My question is can I do anything like that when I use a WCF Service Library? I added the project to my solution and in my web app...

How do I pass a post value from a form element on a parent form to a child form?

I need to get the value from the parent form into the child; not the other way around. Found many a howto from child to parent but that doesn't work for me. I have an onclick event in the input button but I'm unsure how to get the value from this calendar into the child window from here. <form method="post" action=""> <p style="paddin...

Block characters from input text field, mirror input into span or div

I have some html <input type="text" name="name" value="" id="name"> <div id="preview"></div> The rules for entry into the field: Letters A-Z a-z 0-9 space and dash, no other characters allowed Entry of forbidden characters should do nothing The rules for the div: Show each characters as it is entered into the input field Do not ...

Are there CSS class naming standards for web applications?

There is quite a bit of information on the intertubes going over some fundamental css naming conventions. However, most of these conventions are from designer's point of view. I'm going after conventions from a web application developer's point of view. As a web application grows, and UJS (unobtrusive javascript) is used throughout th...

Scroll the page to an <a> with a particular href with jQuery

When the user clicks a button, I want his browser to automatically scroll to an <a> with a certain href (let's call it "abc"). Ideally the scrolling would be nicely animated in some way. ...

Site loads on the right, then shifts to its actual position

There is a link at the bottom. Pretty much what happens, is when the page gets opened, it loads entirely on the right side of the screen. Then when it finishes loading every single element, it moves to the center which is it's actual position. I believe the problem is caused by javascript, since the site works perfectly fine without it...

Using JQuery varaible inside $( php)

Hi , i am having a ajax post like var ht = $.ajax({ type: "GET", url: "http://localhost/FormBuilder/index.php/forms/viewChoices/"+attribute_id, async: false }).responseText; var myObject = eval('(' + ht + ')'); var data = myObject;var j=0; alert(data.choices);//alerts the choices as object $(""+<?php e...

Having problems with anonymous functions in JavaScript.

jQuery.fn.testeee = function(_msg) { alert(_msg); $(this[0]).overlay({ onBeforeLoad: function() { alert(_msg); } }).load(); }; $("#popup").testeee ('test'); $("#popup").testeee ('another_test'); This displays: test test another_test test The alert() inside de anonymous function asigned to onBeforeLoad keeps showing "t...

Built-in browser DOM parsers VS. Javascript framework Parsers

Hello, I'm diving into javascript and one of the concepts I'm playing with is XML parsing. I see that IE has its own parser, as does Firefox. I also see XML parsers built into some of the javascript frameworks like JQuery. My questions are... What's the most common or best way to parse XML using javascript these days? If I use the ...

How to setTimeout() with a jQuery function?

setTimeout(target.mousedown, 200) doesn't seem to work. I can do setTimeout("target.mousedown()", 200), but this feels dirty. What's the right way to do this? ...

Basic JavaScript question - event handlers not calling the function?

So I have the following JavaScript code: <script type="text/javascript"> function clearRadioButtons() { document.getElementById("radiobutton1").checked=""; //etc for more radio buttons } </script> And then in my form, I have the following code: <select name="whatever" onclick="clearRadioButtons()"> <op...

How can I keep a div's scrollbar at the bottom of the div using jQuery?

I have a div called #output, styled with overflow: scroll;. Using jQuery.ajax, it's being updated every x second. I'd like to have it so that when the scrollbar appears (after the divs filled up), it should continously stay at the bottom of the div instead of the top, like most chat clients do. I'm sure there's a way to do this, I just ...

What html/CSS/JS technology widgets does pagii.com use?

I am interested in creating a web page editor like the one used in pagii.com? It's unique among the web based editors I have seen in that it offers a great deal of customization. For example you can insert an image and drag it anywhere on the screen and resize it on the fly. The elements can be placed anywhere on the screen and layered i...

How to work with JavaScript in development then live

I work on front end development and am looking to find a solution for working with javaScript between (non compressed and multiple files) development environment and (compressed and combined files) live environment. I have found a solution with CSS which means that I only need to include one global CSS file with imports, then we combine...

How to check data server side before opening a javascript window

I have an issue going on here. I am using PHP to get values from a database in a php script. What I would ideally like to do is test to see if there is any data to display server side and if there is, pop up a javascript window with the values. I have this working right now with javascript. Currently, the user can look up data and press...

How to prompt feedback when User close browser?

I know this must be done with javascript. But I am not sure how to do it. Scenario: When user close the browser, I will prompt a message whether he/she want to leave comment/feedback or not. If he/she clicks yes, then display(or maybe window.opn/popup), else just close the browser normally. I tried using onload function, but it does ...

JQuery slidedown is misbehaving in IE8

I've been working on this for a while now and it functions perfectly in IE6 (stand alone), IE7 (in IE8), Firefox 3.5 and Chrome 0.2.149 on Windows XP SP3. Using JQuery minimised 1.3.2. It is supposed to work like a file explorer, where you can click an image next to a parent element the sub-elements appear and the image changes to refle...