How To Allow CARRIAGE RETURN And BACKSPACE?
May 22, 2007
This JS limits the input characters into the form. How do I modify it
so that it also allows CARRIAGE RETURN and BACKSPACE (for making text
correction)?
Due to the template engine I am using, I cannot use IF/ELSE statement.
<form>
<textarea name="event_description" ONKEYPRESS="if (document.layers)
var c = event.which;
else if (document.all)
var c = event.keyCode;
else
var c = event.charCode;
var s = String.fromCharCode(c);
return /[0-9a-zA-Zs,.?!@#$%&*()-]/.test(s);"></
textarea>
</form>
View 1 Replies
ADVERTISEMENT
Nov 7, 2011
The function below is triggered via the "onkeyup" event of a text box. I need to test to see if the [enter] key has been pressed, and if so, call a function. With the code below, the pressing of the enter key is traped, but the ascii value for the last "printable" characteris displayed and not chr(13).
[Code]...
View 1 Replies
View Related
Sep 6, 2009
I am trying to do a small website for our family to keep track of each other's home address and etc. Using asp for the codes .. (Its been ages since I indulge myself). I have 2 forms.
In which in FormA, I will key in the following address
666, ST Avenue
#03-09
Anchor View Residence
123456
When I click on submit
it shows this on FormB
666, ST Avenue #03-09 Anchor View Residence 123456
How do I get it to be shown as
666, ST Avenue
#03-09
Anchor View Residence
123456
in FormB
In my formB.asp, for the particular code, all I wrote was {Form.address}.
View 4 Replies
View Related
Mar 16, 2010
I think I have the regex side of this script worked out. But I need to get everything into an array for regex to read. Is there a way to use tokenizer to read everything before a carriage return? Each line should be added to an array for the regex to analyze and parse as needed. It's been ages since I touched tokenizer, so I forgot most of it. This is the text area in the html that the script should reference.
<textarea cols="60" rows="14" value="" id="paste" name="paste">
View 3 Replies
View Related
Oct 13, 2005
I'm trying to load an ASP recordset into a javascript array via an ASP array. The way I've been attempting to do it is by having ASP "Response.Write()" the javascript code that builds the javascript array. It ALMOST works :rolleyes:
The problem I'm having is that the ASP writes the different javascript lines as one long line (ie. no carriage returns). Therefore, the javascript lines are not recognized. When I take the source code and manually separate the lines produced...then when I run the modified source, it works fine. Code:
View 1 Replies
View Related
Jul 20, 2005
I have a calendar where i write my events.
If I have 2 events in the same day, how to put a carriage return between the
events in the alert part of message?
For example, I want this alert message:
Event one to the office.
Event two to the store.
The string that I use actually is:
fAddEvent(2003,9,17," Event one. Event two.","alert('Event one to the
office. Event two to the store.');","#00ff00","red");
View 2 Replies
View Related
Oct 21, 2009
I am building a string inside a variable prior to printing it on screen as follows :
myclock += hours+':'+minutes; where "hours" and "minutes" are variables initialised elsewhere. How can I add a carriage return or new line character to the end of this line, so that anything else cocatenated to this variable is displayed on the next line.
View 5 Replies
View Related
Dec 16, 2009
I'm creating a new email in javascript via outlook. When i try entering a line break " etc, Outlook just ignores it completely. I've tried using "%0D%0A" and "fromCharCode(10)" as well but it doesnt seem to read it as a line break. Is there any way to code it so that a line break or a carriage return appears on outlook?
View 1 Replies
View Related
May 30, 2007
I there a quick routine that removes trailing newline chars and carriage return?
View 5 Replies
View Related
Jun 22, 2006
I have a page with a div on it. The div displays a user comment. When
the user logs into this page, their current comment is pulled from a db
and displayed in the div. The user can edit the comment through a
pop-up that contains a textarea. When the user hits OK on the pop-up,
the text in the textarea is sent to a function on the main page. The
function inserts the text into the div's text node.
Please don't ask why I'm making this so complicated - there are other
things going on on the page and the pop-up that are irrelevant to my
problem.
Everything works perfectly except when the user puts carriage returns
in their comment. For some reason I can't get the carriage returns to
show up in the div. BUT! When they view the existing comment in the
div (the one pulled from the database) the carriage returns are
displayed. That initial display does not use any javascript - it's
just php so the page is initially rendered with the text in the div.
So it seems that when I programmatically put text into my div, the
carriage returns don't show. But if the page is rendered with the text
already there, the carriage returns do show.
This seems like it should be so simple, what am I doing wrong??? Do I
have to replace the carriage returns with a different character (e.g.
<br>,
,
,
,
)? Or is there a css setting for the div?
View 7 Replies
View Related
Apr 19, 2005
In a textarea, is there a javascript (or something in php) that will convert carriage returns to spaces when submitted? The textarea on these forums does what I'm trying to accomplish but I've looked at the code and I cannot figure out how it's done.
View 4 Replies
View Related
Jun 25, 2004
Just a quicky how can i disable the backspace. I have found code for the enter key but dont understand it. code...
View 10 Replies
View Related
Dec 7, 2010
I have created a keyboard on Taco HTML via a table of buttons and within this keyboard I need a functioning Backspace button using javascript. I currently have a 'reset' button which clears all of the values in the text box.
View 3 Replies
View Related
Aug 24, 2007
Could someone point me in the right direction for making a key function that removes one character from the beginning of a string every time it is pressed (basically the exact opposite of a backspace key)?
View 3 Replies
View Related
Feb 28, 2011
I have to go back to specific page(html page) using backspace button in javascript n html.
View 4 Replies
View Related
Jul 16, 2010
<script language="javascript">
function disableback(evt) {
if (evt.keyCode == 8 || evt.which == 8) {
return false; /*have also tried return (evt.keyCode != 8) and evt.which == 46 and the variations*/
}}
</script>
<input type="text" onkeydown="disableback(event)" onkeypress="disableback(event)">
I am doing my testing on Firefox. From posts this should work to stop from the page going back yet no dice. I currently have the text area in a frame and have it reload keeping all text in a variable, it just seems awful sloppy.
This may work on IE, have yet to test. Just trying for FF atm.
View 5 Replies
View Related
Nov 4, 2010
I have a keypad that inserts a number into a div (simulates pin number). How do i create a "backspace" or delete button that will remove the last character added.[code]...
View 4 Replies
View Related
May 6, 2004
I've been getting some complaints from my users: when filling out forms, while on a select box, pressing the backspace key would actually mimick pressing the back button (like history.go(-1) ...)
Then I realized that if the user wasn't in a textbox or a textarea, pressing the backspace key would send them back one page. Now I've got a multi-page form in an iFrame and that's really screwing their inputs up as it loses all the information entered in that form (pressing back doesn't submit/post backwards... I wish it would!).
So anyway, here's the script I'm using on all my pages so that the user won't 'accidentally' go back a page. (In my opinion, with my users anyway, a user shouldn't need to hit the backspace unless they're in a textbox or a textarea).
//so backspace doesn't go back
document.onkeydown = checkForBackspace;
function checkForBackspace() {
//we can backspace in a textbox
if(window.event.srcElement.type.match("text")) {
return true;
}
if(window.event && window.event.keyCode == 8) {
// try to cancel the backspace
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
}
This is IE only. srcElement is an IE thing.. I believe most other browsers use target. I don't know what else would be different, but anyway, that's what I'm using.
BTW: If you're wondering why anyone would press backspace in a selectbox, well I recently showed them that you can press the first letter of an item in the list to quickly jump to that item. Well, perhaps naturally, if they press the wrong key, instead of pressing the right key, they try to hit backspace first. Just if you were curious... I guess checkboxes and radios could be similar?
View 3 Replies
View Related
Sep 4, 2007
In my web application(ASP.net), i need to disable the "Back" button in the browser.Moreover i also need to disable the Backspace key in my keyboard when my web page is run..How to do it with javascript..?
View 9 Replies
View Related
Nov 8, 2006
I'm using the below to limit the input into a text box to just letters,
numbers, hyphens and full stops, but I also need to allow the backspace,
delete and arrow keys to come through. How can I do this?
<script language="JavaScript" type="text/javascript">
<!--
function onKeyPressBlockNumbers(e)
{
var key = window.event ? e.keyCode : e.which;
var keychar = String.fromCharCode(key);
reg = /^[.a-zA-Z0-9_-]*$/;
return reg.test(keychar);
}
//-->
</script>
<form>
<input type="text" onkeypress="return onKeyPressBlockNumbers(event);" />
</form>
View 9 Replies
View Related
Nov 30, 2011
I have a modal window with a few textboxes, one button and a few labels. I need to disable the backspace key, unless any of textboxes is in focus, if this the case, user allows to delete the text from the textbox.
View 3 Replies
View Related
Sep 1, 2009
When i have:title="test|contentwithoutspaceeeeeeeee">hover</a>if the width of the text is more bigger than the configuration ofcluetip, the text continues out of cluetip box.Have one way to solve that?
View 2 Replies
View Related
Jun 22, 2011
I have a form element that is readonly. <input type="text" id="kfs_acct_1" readonly="false" /> This field is dynamically populated an making it readonly prevents users from changing the value in this field. The problem I have is users click on the field and try to delete it's value. They click in the field and hit their Backspace key. This takes them away from the page to the page from whence they came. Because of the way the form is set up, doing this makes them loose all the data in the form (the one with the readonly box). How can I prevent the Backspace key from fireing and taking the user away from this page? I've tried a few things, but apparently making a field readonly keeps some key events from being seen.
[Code]...
View 1 Replies
View Related
Dec 14, 2005
Im trying to find a way to disable the keyboard backspace button from going back a page but allowing it to go back a character.
The problem happens with our webmail client when composing a message, if the cursor is not in the textarea and backspace is clicked it goes back a page and everything typed in the textarea is lost, its easy to do because we use a cms menu thats always active, and distract the cursor, and its very frustrating. Code:
View 7 Replies
View Related
Jun 3, 2010
All is on the title, sorry for my english, i'm french :) I have an html page with style
<style>
#mydiv {
margin-left:auto;
margin-right:auto;
width:250px;
}
</style>
with jquery, i try to get the margin-left ($('#mydiv').css('margin-left'), but the function return 0px, unable to retrieve the good value (auto) anyone has idea to retrieve the value "auto" when margin-left is "auto" ?
View 1 Replies
View Related
Nov 10, 2009
I'm using Firefox 3.5.5 on Vista 32 Home Premium SP2 and only recently noticed that (javascript/jquery being enabled) link focus is lost when you tab through a page, follow the link to another page and then hit the backspace key to come back. Tab navigation continues at top of page, not with the next link after the one in focus before.
No problems in this respect with IE8 and Opera. As soon as you disable javascript with noscript, the problem disappears and link focus stays, so that tabbing brings on the next link instead of starting on top of page again.
Just confirmed it on jquery/com (following navigation link to Plugins and hitting backspace) and on learningjquery/com (navigation links). A Google search didn't yield any answers nor even any similar reports on this particular problem.
It's even more irksome in my particular case, since I have just implemented a stylesheet switcher in order to enhance certain accessibility aspects, but ironically this particular bug leads to a loss of accessibility.
Does anybody know what might be the reason (version 1.3.2.min related?, cookies related?, etc.) for this and how to solve it?
View 7 Replies
View Related