Category "dom-events"

Cancelling JavaScript events in IE11

I have some historical code that's using event.returnValue = false to prevent CR from causing a post back in an ASP.NET via the onkeydown event: onkeydown = "if

Form value to be empty if no change by user

I have a form with two inputs: <input type="text" name="keyword" value="Search" onfocus="wipe(this)"/> <input type="text" name="city" value="City" onf

Form value to be empty if no change by user

I have a form with two inputs: <input type="text" name="keyword" value="Search" onfocus="wipe(this)"/> <input type="text" name="city" value="City" onf

Submitting forms using JavaScript

I have been battling for the past two days with the evil onbeforeunload function in JavaScript. I have a function that warns the user when they are about to clo

How can I react to 'onchange' and 'aspx state' information for a form dropdown?

I'm after what seems to me to be a straightforward pattern for handling page refreshes when I've got a drop-down that reacts to the onchange event. I've used th

onKeyUp event calculation not working on the following rows from php generated forms except the first one

-------------------------------------------------- |No|Style No|Item Desc|Qty|Unit Price|Total Price| ----------------------------------------------

Javascript validate form is not preventing submit

I have a form and I do JavaScript validation function onsubmit: <form method="post" onsubmit="return validateForm(this.id)" action="<?php echo $PHP_SELF;

How to check multiple function in JavaScript

I have many functions written in JavaScript such as userName(), password() etc. But on submitting on the form, I have a single function return formValidator();.

In ASP.NET, After Selecting "Stay On This Page" nothing is working

I am using this code for preventing user to leave the page if there is any changes on the form in SharePoint FarmApplication <script> var formDirty

Replace traditional event call with JavaScript event listener

With the following code: <head> <script type="text/javascript"> function popupMsg(msg) { alert(msg); } </script> </head> <body>

Fire Button click event during onsubmit

I want to fire a click event during the onsubmit of form. In button click event I used a url which it has to redirect. I don't want to use the form's 'action" t

Pre-populate form field with the text from a <p> using JavaScript

I have this on a page: <p class="test" style="width: 300px" title="intro">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh

Two buttons one form

<?=form_open('blog/register');?> <table> <tr> <td><label for="register_name">User

How to get where onclick function is called JavaScript

Can anybody give me the syntax on how could I determine where the onclick event was called. I want to change the h4 content depending on where the onclick came

Inline handler not being called in IE9 for select element

I'm trying to figure out what could be causing a problem in IE9 on a production machine. We have a <select> combo box with an inline change handler (I'm a

How do I use a function through iframe?

I have a web page which has a form at the top and a table at the bottom. The form allows users to submit info and also upload an image, the form's target is the

Cancel onclick event in IE5

I want to cancel inline onclick event <p id="demo" onclick="alert(1234)"></p> in certain condition, so I am using a global onclick event to conditi

How to make HTML element resizable using pure Javascript?

I was wondering how we can make a HTML element like <div> or <p> tag element resizable when clicked using pure JavaScript, not the jQuery library or

How to access textbox inside grid view of parent page in popup page?

I have a pop up page where I want to get the textbox value which is inside gridview of main page, and populate value in that textbox. I have tried: var Emp =

Deactivating and activating an E-mail form

I'm trying to get the code below to keep an E-mail form deactivated until 6 seconds after the page is fully loaded. What can I do to make it work like that? var