Disable Keystrokes On Input?
Mar 31, 2011
I have a quantity field where I'm only allowing a max of 3 numbers (numbers only) in addition to the tab and backspace keys. I want to include the delete key, but it appears both the delete key and the "del" key on the numeric keypad share the same charcode (46). If I allow for delete, I can't figure out how to not allow for the "del" decimal.
Am I missing a charcode or what?
View 1 Replies
ADVERTISEMENT
Nov 24, 2005
I'm trying to make my WYSIWYG editor cross-bowser compatible. To do this I'm contemplating a way to capture keystrokes, but have no clue to go about it.
For example:
If the user presses enter, I want to capture the keystroke and return a <br> tag or if the user presses ctrl + B, I want it to return a <strong> tag.
View 4 Replies
View Related
Jul 27, 2009
I'm trying to detect keystrokes using Javascript. My code (so far) works in Opera and Safari, but not in Firefox, Netscape/SeaMonkey/Mozilla, or Chrome. (I have no idea if it works in IE; IE has other problems with my code.)What I've done is attached a onkeydown listener to the body tag. (I've also tried it with onkeypress and onkeyup.) Right now all I'm trying to do is detect a key press -- any key press -- and throw an alert as a result. I've tried it two separate ways -- with straight Javascript and with MooTools, which I'm using for the rest of my project.
The code I have is as follows:
mootools version
$(document.getElementsByTagName('body')[0]).addEvent('keypress', function(event) { alert('key has been pressed.'); });
regular javascript version
document.getElementsByTagName('body')[0].addEventListener("keypress", function() { alert('key has been pressed.'); }, false);
Both versions work in Opera and Safari. Interestingly enough, if I attach a click listener to the body using the exact same code as above, but changing the word 'keypress' to 'click', they both work in Firefox as well. I can't figure out how to get this key listener attached.
View 7 Replies
View Related
Mar 3, 2010
I want to use JavaScript to detect the number of times a key (for example, the A key) is pressed. Once it reaches a preset number (say 10 for this example), it will trigger two events:
1. Change the background color of a cell in a table from white to black.
2. A split-second (e.g., .01 second) later, submit the form on this page.I can't have the user hit the ENTER key to submit the form, so the JavaScript script will need to do this.
View 6 Replies
View Related
Aug 8, 2011
What I'm making is like a slow chat to communicate with faraway friends. I want to disable only an input with the id "name" after the user submits a form. I also want to store the input in a cookie for later. (So if the user logs in again the input is disabled with the "name" in it.)
I was stuck at the disabling. The problem is that every time the user clicks on submit, the page refreshes and the disable switched off. Isn't there a simple way to fix this?
So far, the Javascript is:
Code:
function disable(){
document.getElementById('name').disabled=true;
}
And then the submit button runs the script.
View 1 Replies
View Related
Jan 24, 2011
I was trying to but failed to do. I have two radio of gender and two input box father name and husband name if sex selected male then fathers name will be enabled and husband name will be disabled and if female selected then fathers name will be disabled and husband name will be enabled.
<input type="radio" name="sex" value="male" /> Male
<input type="radio" name="sex" value="female" /> Female </div>
Father's Name<input type="text" name="fname" />
Husband's Name<input type="text" name="hname" />
View 2 Replies
View Related
May 2, 2009
I have a page with a few divs. One of the divs contains several anchors, text boxes, and list boxes. Under certain error conditions, I need to disable all the anchors, text boxes, and list boxes inside that div (but other divs on that page should not be disabled).
View 3 Replies
View Related
Apr 22, 2009
I have a form, in that form element I have a Date element. I use this script available at [URL] CalendarPopup to get the date from the user. Since, I want the date in a specific format (which the CalendarPopup script gives me) so I want the user to use the calendar popup rather than inputting the field by their hands . How is this possible? I disabled the form element but that won't let me use the calendar popup too
View 3 Replies
View Related
Jan 26, 2011
I have a html form with three input text box. one of the three is disabled by the help of this postmy question on jquery forum.no I want that if any of two of the input box is empty submition button will be disabled if allenteredthen submit button will be enabled.
View 1 Replies
View Related
Sep 3, 2010
I have a form with texts inputs and a submit button... The page has post parameters from the previous page. Now when I press enter key on one of the text inputs, the posted parameters were gone... Do you know how to disable enter key for this purpose
View 1 Replies
View Related
Jun 14, 2011
How to disable drag and drop to/from an input text?
View 1 Replies
View Related
Feb 10, 2011
i am using <input type = "file" id = "upload"> in my html page. i want to disable the textbox of this control so that user cannot type any file location here. user can upload file only through browse button.
is there a way to disable this textbox thru javascript?
View 2 Replies
View Related
Jul 26, 2011
I'm wondering if it's possible for a script to enable/disable all input elements on the page with some sort of toggle button. I googled it but didn't find anything too useful except for this: [URL] but I'm not sure how to edit it for the toggle.
View 9 Replies
View Related
Sep 29, 2007
I've created a admin center, that has two seperate login permissions. Admin which can edit listings, etc... and Viewer which can only view listings, and edit 1 or 2 of the listings details and not all of them like the admin. I've seen web-sites where certain text input fields are sort of Grayed out, not allowing for user to type, click in or change anything in that field. Sort of like the html text input field has been or is disabled. How can I get certain html text input fields to appear disabled, and the text that's inside un-editable or unchange-able?
View 3 Replies
View Related
Feb 9, 2011
I am using <input type = "file" id = "upload"> in my html page. i want to disable the textbox of this control so that user cannot type any file location here. user can upload file only through browse button.
is there a way to disable this textbox through javascript?
View 3 Replies
View Related
May 6, 2009
I created a test page here: [URL]. But basically the problem is that $("#button").attr("disabled",true);
should disable a input button, and it does, HOWEVER it outputs disabled="" when it should output disabled="disabled".
View 8 Replies
View Related
Jun 7, 2010
I am having a form with two input fields. I want to enter some text in the first input field and then the second field should get the same text. Is there a simple way (maybe a plugin) to do this with jQuery? It would be perfect if I even could output all these input fields values as normal text in <p> or <li> tags.
View 2 Replies
View Related
Mar 16, 2011
As recently as 1.4.3 $('input:text') would find input elements with no type attribute, but after upgrading to 1.5.1 that is no longer the case.
Is this a bug or an intended refactor to be more standards compliant?
FYI - this is the selector I now have to use: $('input:text,input:not([type])')
View 4 Replies
View Related
Nov 20, 2011
Jqtransform Firefox Input Problem Basic problem is the text inside of the form input is lower than it should be.
View 2 Replies
View Related
Sep 7, 2009
I have a pretty basic set of things I want to do: Capture key press, compare against an allowed list, block keys that are not in that list, replace a space by a dash if entered. As this is happening, I have a span I wanted to be updated with the live values. The username field at [URL] is exactly what I am trying to do, though I have trouble dissecting how they did it. Here is my attempt, which is off by one keypress for some reason.
[Code]..
View 2 Replies
View Related
Jan 26, 2011
I have 2 windows - parent and children.
in parent
<form name="calc" action="" method="post">
<input value="0" type="text" name="pay" id="pay">
</form>
in child
<form name="payment" action="" method="post">
<input value="0" type="text" name="pay_str" id="pay_str">
</form>
how can i transfer data from parent input to child input?
View 3 Replies
View Related
Jun 17, 2009
I have a form and there are many form fields, is anyone know how to make one of my input text only for display purpose, not for input.
View 5 Replies
View Related
Jun 15, 2011
I am trying to create a text area input filed for user input, and i want to be able to allow the user to format thier text, just like the ones used in this user forum. I am writing my website in html, php, javascript and css with a MySql database. I am trying to understand how to create such an format-able text area for input.
View 1 Replies
View Related
Oct 29, 2010
I've got a form in which the fields are being dynamically generated based upon a db query.. it looks something like this:
Code:
<form name="bft">
<input name="colA_1"> <input name="colB_1" onBlur="loadXMLDoc(this.value,'colC_1');"><input name="colC_1">
[code]...
I'm trying to use AJaX to populate the third input in the same row as the second input based upon a separate db query. Here's the code for that:
Code:
<script type="text/javascript">
function loadXMLDoc(v,n) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
[code]...
Here's where it displays on the page<cfoutput>#trim(getITRRSP.[columnName])#</cfoutput>
Whenever the focus blurs from those inputs, the third column in that row is populated with "UNKNOWN" as the value. I have confirmed that the getITRRSP.cfm file is properly retrieving and displaying the data from the db query.
View 1 Replies
View Related
Jul 23, 2005
I have an array of input text boxes (txtDOBn) where n is created at
load. On the onchange event I want to calc the age and show in adjacent
input text boxes that are readonly and also arrays (an age calced for
each DOB entered). I was going to use the datediff function in vbscript
to do the calc. Code:
View 12 Replies
View Related
Feb 15, 2011
Is it possible to copy the value of a visible input field to a hidden input field?
View 1 Replies
View Related