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...
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...
Once again the IE Monster has hit me with an odd problem.
I'm writing some changes into an asp.net site I inherited a while back. One of the problems is that in some pages there are several controls that add javascript functions as handlers to the onload event (using YUI if that matters). Some of those event handlers assume certain ...
I have some text inputs which I'm validating when a user tabs to the next one. I would like the focus to stay on a problematic input after showing an alert. I can't seem to nail down the correct syntax to have JQuery do this. Instead the following code shows the alert then focuses on the next text input. How can I prevent tabbing to the ...
If a form has same tag repeatedly.
How to get its value in javascript.
<script>
function validate()
{
//get all values of elmone
}
</script>
<form>
<input type="text" size="15" value="Hello World" name="elmOne">
<input type="text" size="15" value="next Hello World" name="elmOne">
<input type="button...
Hi every body. i want to add and remove some html input in javascript
i have done for add function . it work properly. but unable to remove. my code is following
fields = 1;
function addInput() {
if (fields != 10) {
...
I am using the following functions to do my task. It works fine when cursor moves away from textbox but if i want to fire the same event from code say like next function i get error...
function addEvent( obj, type, fn ) {
if (obj.addEventListener) {
obj.addEventListener( type, fn, false );
}
else if (obj.attachEvent) {
obj["e"+ty...
How to detect an event coming from the Firefox history dropdown box?
I need to distinguish between the enter key simply pressed on input field or on item from his native history dropdown box.
The reason is that I would like to call custom submit button (not first one, which is default) on the enter key pressed on any input field. But r...
How to check for comma separated values in a text box and raise an alert if not found.
And there is should be characters in it like A,B,C,D
function validate()
{
//validate text box;
}
<input type="text" id="val" >A,B,C,D</input>
<input type="button" id="save" onclick="validate()">
Thanks.
...
I have a web application build on asp.net, the Textbox onchange event not working in chrome? On page load i wrote this code,
textbox1.Attributes.Add("onchange", "SetEditDataFlag();");
SetEditDataFlag() -- it is a javascript function. When I browse the application in chrome then this function is not called when i changed some value on...
I have a photo gallery web page where a single <img src="XXX" /> element's src is changed (on a click) with javascript to show the next imagea poor man's ajax I guess. Works great on faster connections when the new image appears almost immediately. Even if it takes a few seconds to load, every browser I've tested it on keeps the old imag...
I am trying to fire the asp.net button click event from javascript. Its working fine in IE, but the same code is not working on Chrome, please help me. Here is the js code,
<script type= "text/javascript" language="javascript">
var btnSave = document.getElementById('btnSave');
btnSave.click();
alert("The changes are saved su...
How to validate a textarea in a form.i.e, it should not be empty or have any new lines and if so raise an alert
<script>
function val()
{
//ifnewline found or blank raise an alert
}
</script>
<form>
<textarea name = "pt_text" rows = "8" cols = "8" class = "input" WRAP ></textarea>
<input type=""button...
I write the following code all the time to handle when the enter key pressed:
$("#selectorid").keypress(function (e) {
if (e.keyCode == 13) {
var targetType = e.originalTarget ? e.originalTarget.type.toLowerCase() : e.srcElement.tagName.toLowerCase();
if (targetType != "textarea") {
e....
I have a jQuery function with basically makes an entire table row clickable, but copying a link and duplicating the link in each child cell in the row. In my projects, some of the links may have onclick javascript events, so I need my function to be able to copy those events as well, but I am having trouble doing that.
Here's my curren...
Hi,
I have a website which uses jquery and lots of mouseover/mouseout effect. So far I used the .bind() method of jquery but if you have >1000 event handlers, this is slowing down your browser a lot. So, I want to move to use .live or .delegate.
One part of my portal site is a chat area. User can set chat messages which will then be ...
If I have a function like the following:
function catchUndefinedFunctionCall( name, arguments )
{
alert( name + ' is not defined' );
}
and I do something silly like
foo( 'bar' );
when foo isn't defined, is there some way I can have my catch function called, with name being 'foo' and arguments being an array containing 'bar'?
...
The question was fairly descriptive but I'll describe it further.
Basically, I have window1. Clicking a button link opens window2. Clicking a button in window2 opens window3, clicking a button in window3 should bring window2 back to the front of the screen on top of window2.
I'm not sure how this is exactly done, however I have used an...
In the below code,the textaraes are generated dynamically ,now how to get these values for validations in valid() function..
<script>
function valid()
{
//get all textarea vales for validation
}
function add(col_det)
{
var row = '<tr>';
row += '<td>';
row += '<textarea rows = "8" cols = "8" class = "input" W...
I'm using JQuery to load the content of an mvc usercontroll:
function menuShowModal(a) {
$.ajax(
{
url: a.href,
success: function (result) {
$('#modalDialog').dialog('close');
var $dialog = $('<div id=\'modalDialog\'></div>')
...