onchange

ASP.NET/VB.NET: Dropdownlist SelectedIndexChanged not firing with onchange=“javascript:return true;”

半腔热情 提交于 2019-12-05 13:48:30
I have the following markup: <asp:DropDownList ID="dd1" AutoPostBack="true" runat="server"> <asp:ListItem Value="1">1</asp:ListItem> <asp:ListItem Value="2">2</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="dd2" AutoPostBack="true" onchange="javascript:return true;" runat="server"> <asp:ListItem Value="1">3</asp:ListItem> <asp:ListItem Value="2">4</asp:ListItem> </asp:DropDownList> Wired up to this: Protected Sub changed1(sender As Object, e As EventArgs) Handles dd1.SelectedIndexChanged End Sub Protected Sub changed2(sender As Object, e As EventArgs) Handles dd2.SelectedIndexChanged

Javascript Eventlistener for Update / Change on Element / innerText

不羁的心 提交于 2019-12-05 12:10:17
Is there a eventListener who is just checking the changes of an innerText? Example: 12345 I just want to check if "12345" is changing to something else like "23415". There is no "click" event that will comes up or anything else. I don't have the chance to go through the code where the updates from the span's are coming. So I really can just only grab the event from the changes in the span element but I don't have any clue how. Sorry for my bad English and thanks! Check out the MutationObserver . Using it you can listen to changes of the observed element's characterData . Example: HTML <span

How to use jQuery and 'this' to capture changed form element value

坚强是说给别人听的谎言 提交于 2019-12-05 09:34:53
I have the following code that works each and every time an element change happens within my web form: <!-- jQuery.support.cors = true; // needed for ajax to work in certain older browsers and versions $(document).ready(function(){ $(this).change(function(){ alert('form element changed!'); }); }); // end .ready() //--> What I have been struggling with is how to capture the form field element id , name and changed value when the change event is triggered. Can anyone help me out on this? Thanks! ** JAVASCRIPT FILE ** // Sarfraz $(this).change(function(){ var id, name, value; id = this.id, name =

Event.observe 'change' events not being triggered in IE

[亡魂溺海] 提交于 2019-12-05 08:26:58
The Prototype event listener I use for changes in select menus is not being triggered in IE. Event.observe('use_billing', 'change', Checkout.getBillingData); This works fine in Firefox (of course), but nothing happens in IE (of course) - I've been Googling this for some time, but I have not found a suitable solution to this problem. I read there are problems, but I found nothing useful to circumvent the issue and get this to work. I am really trying to avoid using inline event triggers, because they are obtrusive and make for a messy document prone to errors: <select id='use_billing' onchange=

detect change on navigator.online

扶醉桌前 提交于 2019-12-05 08:12:06
How can I detect if the navigator changed your state to online/offline? something like: var oldState = navigator.onLine; window.navigator.onlinechange = function(evnt,newState) { alert('your changed from' + oldState + ' to' + newState + 'state'); } Something like this (not every browser supports these events, currently only IE 8,9 and FF > 3 support these events): var el = document.body; if (el.addEventListener) { el.addEventListener("online", function () { alert("online");}, true); el.addEventListener("offline", function () { alert("offline");}, true); } else if (el.attachEvent) { el

textbox onchange call php function [duplicate]

北战南征 提交于 2019-12-05 07:18:47
问题 This question already has answers here : Call php function from JavaScript (4 answers) Closed 5 years ago . How can i call a php function from onchange on an html form textbox? I have tried <input onchange="phpfunction()" ..... > <?php function phpfunction() { my function } ?> Any Help? I Can't seem to figure it out. Thank You 回答1: You have to do an ajax call and post that your PHP. Example: HTML: <input name="blah" onchange="mainInfo(this.value);"> Javascript Function (AjaX) function

Set Label Text with JQuery

送分小仙女□ 提交于 2019-12-05 03:21:38
This should be quite straight forward, however the following code does not do anything as far as changing the next label's text. I have tried using .text, .html, and so on to no avail. Is there anything wrong with this code? <script type="text/javascript"> $(document).ready(function() { $("input:checkbox").on("change", checkboxChange); function checkboxChange() { $("#"+this.id).next("label").text("TESTTTT"); } }); </script> <td width="15%" align="center"><input type="checkbox" name="task1" id="task1"></td> <td width="25%" align="center"><label for="task1"></label></td> The checkbox is in a td

Button onclick doesn't fire after onchange input-field when user immediately clicks the button

做~自己de王妃 提交于 2019-12-05 03:08:18
I have an input text with an onchange event that calls a function in which an alert box displays. I also have a button whose onclick calls a different function. If the user makes a change in the input text and immediately clicks the button, the onchange event fires, displaying the alert box, but the code in the function for the onclick of the button doesn't execute. I've read that this has something to do with event bubbling, but I haven't seen any solutions. Is there a solution? Is it even possible? Here is a little example: <input type = "text" onchange = "showAlert1()"> <input type =

Determine whether form input has focus

落爺英雄遲暮 提交于 2019-12-04 23:47:18
I'm doing validation in AngularJS, and I have a div that is displayed if there are 3 types of errors. For required I want to show the error message only if the page is submitted with empty value <div class="error" data-ng-show="submitted && mainForm.email.$error.required" /> For the regex validation I want it to flag real-time, default behavior. <div class="error" data-ng-show="mainForm.email.$error.pattern" /> The problem I'm facing is with minlength. I don't want to show it while they are typing. It's annoying because they haven't finished typing. I don't want to display it on submit either,

Rails: how to get value from another field when executing an onchange remote function in textfield

时光毁灭记忆、已成空白 提交于 2019-12-04 20:55:30
I want to create a form for making a reservation for borrowed items. A reservation consists of pick up time, return time and items the reserver wants to borrow and their amounts. For example, I might want to reserve three plates, three knives and three forks for the rest of the week. In the form, I want to do an AJAX validation that checks whether there is enough items available. Next to each item I have a text box with which the reserver inputs the item amount. After the input, I want to do an onchange call that checks if the amount of items is available for the given dates. Thus, I need to