|
keyup / keydown should work. Please post:
- A small piece of code that illustrates the problem.
- The browser(s) and operating system(s) you're testing with.
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
<input size="30" maxlength="15" id="txtbox_license" onKeyDown="OnTextbox_Changed('vehicle', 'txtbox_license');" />
I've tried onKeyDown, onKeyUp and onChange .
onChange works, but only if the textbox looses focus. (which is not what they want)
onKeyPress works, but only if you type a second character. onKeyUp and onKeyDown also don't seem to work immidiately.
The function that handles the event works correctly.
many thanks.
|
|
|
|
|
Can you post the event handling method?
|
|
|
|
|
I'm not sure if I may.
If it is any help, my first statement is debugger which fires when I use the onchange event, but not when I use the other ones...
these are the first lines:
function OnTextbox_Changed(page, id){
debugger
var txtboxid = page+id;
document.getElementById(id).value = document.getElementById(id).value.toUpperCase();
switch(txtboxid){
}
note that this works perfectly when using the onchange method !
anyway thanks for the effort in any case !
|
|
|
|
|
I found the problem .
I checked my code in the webbrowser itself instead of embedded in the application ... it works.
thanks for your help.
|
|
|
|
|
Ok... Let's try something else. Throw this in a little test HTML file. It should display what you type, as you type it. Let me know how this fails.
<script>
function ShowText()
{
var input = document.getElementById("input");
var output = document.getElementById("output");
var txt = input.value;
if ( output.textContent != null )
output.textContent = txt;
else if ( output.innerText != null )
output.innerText = txt;
}
</script>
<textarea id="input" style="width:90%;height:6em;" onkeyup="ShowText()"></textarea>
<div id="output"></div>
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
Dude,
this seems to work.
I'll analyze what you did and try to implement it.
I'm curious though, at first site, it looks like you did the same I did.
thanks for this effort !
|
|
|
|
|
I found the problem .
I checked my code in the webbrowser itself instead of embedded in the application ... it works.
thanks for your help.
|
|
|
|
|
Hi,
Please use this code.
I have used this code for numeric characters.
|
|
|
|
|
How to access Internet explorer favourites in ASP or in javascript
-- modified at 7:55 Wednesday 7th March, 2007
SP
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
If you want to add one, you need to do:
window.external.AddFavorite(location.href, document.title);
If you want to play (ie: edit, delete, see other fav's) with them, i don't think it is possible because of security reasons.
-m
|
|
|
|
|
Don't.
Those are the users', not yours.
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
hi
this is malayappa
we have a game developed in Little Movie processing source format i.e
.LS extension and we need a compiler to compile the LS files in windows.
please help in this regard
Thanking you
malayappa
|
|
|
|
|
|
Hi,
I'm having a RadioButtonList that has two RadioButtons. One has "Good Mood " and the other one "Bad Mood". But I want whe one is selected it may come with a particular smilie. How could I go about this?
Thanks
|
|
|
|
|
How can i get the selected text of a document in javascript.
var text = document.Selection.createRange().text;
When i use above line of javascript, i come across the following problem.
If the word to be selected occurs at several times at several locations in the document and if i select a word any where in the document,only the first occurence of that word is being taken into account.
The selected particular word at paticular position is not considered.
|
|
|
|
|
|
sudidelaravindra wrote: var text = document.Selection.createRange().text;
This, on IE, will give you a string representation of what the user has selected. That's all - you don't get the position in the document, what nodes are included, etc. - for those, you'll want to examine the range object directly.
What are you trying to accomplish?
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
based on the selected text i get length of selected text.If i add this length of selected text to the starting index of selected text ,i will get end index of the selected text.
var element = document.getElementById('lblselectedtext').innerText;
//here entire text is stored in element variable.
var selectedText = document.selection.createRange().text;
var startingIndex = element.indexOf(selectedText);
var endIndex = startingIndex + selectedText.length;
here the problem is the first occurence of the selectedText's startingIndex is always taking into the account.
Eg.
"Practice more on javaScript.The more we practice the more we acquire."
is the sentence we have.
If i select the word "more" which occured at the second time in the above sentence and tried for its starting index it should give '32' as the starting index but i am getting the starting index of first occured "more" i.e '9' as the starting index.
Hope u understand the problem.
|
|
|
|
|
I see. Sadly, indexOf() isn't terribly useful for this sort of thing, for just the reason you've found. Try something like this:
var selRange = document.selection.createRange();
var compRange = document.body.createTextRange();
compRange.moveToElementText(element);
var startDist = 0;
while (selRange.compareEndPoints("StartToStart", compRange) > 0)
{
++startDist;
selRange.moveStart("character", -1);
} (full example: here[^])
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
http://www.quirksmode.org/js/selected.html
-------------------------
Don't worry, be happy )
|
|
|
|
|
Hi there,
I am passing following in html:
<a href=phpFilepath?action=tagClicked&uploadId=2 rel = 'tag' >associatedText</a>
now on clicking on associatedText I am getting uploadId in php and from that I am fetching server Path that is stored in database.
suppose my server path = "ftp://userName:Password@ftp.example.com/TempUpload/Doc/Case Studies for Uploading.doc"
this is giving me not readable result of the file.
Can you please tell me how can I open the file in readable manner??
|
|
|
|
|
So is the problem that you cannot read the file from the FTP server?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
No I got the file in the same browser with not readable fonts that are like square, circle etc. But I want the same file in open another browser with the same formating that has been in the file located at the server.
|
|
|
|
|
If i understand correctly you want them to be able to, say, have the "save file" dialog pop up. If so you want:
header(<code><span class="string">'Content-Disposition: attachment; filename="[FILE NAME]"');</span></code> <span class="string"></span>
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|