|
Yes I have posted the exact code,but now code is working.Thanks for the help.
|
|
|
|
|
Those damn gremlins
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hi ALL,
I wnat to allow only number in the textbox throug javascript.I wrote the Java script code but it say error in the script.Some one can tell me what is the problem??
<HTML>
<HEAD>
<SCRIPT language=Javascript>
<!--
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<INPUT id="txtChar" onkeypress="return isNumberKey(event)" type="text" name="txtChar">
</BODY>
</HTML>
Thanks in advance.
|
|
|
|
|
What exactly is the problem?
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
I dont know thats why I posted the code.But its not working.
|
|
|
|
|
Can you please explain what is not working, what are you trying tot do, what are you entering and what is occuring.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Actually I want to allow only number in a textbox not alphabets. The code which I have posted is accepting both and also special symbols. I can just see on the status bar that error in script.
Please help me in doing this...
|
|
|
|
|
please double click on the status bar and type the error here.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
I just ran the script you have me on FireFox 2.0 and IE7 and it works absolutely fine. You must have Javascrip enabled because of the error.... I ave not idea what the problem could be....
What browser are you using?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
I am using IE 6.0. I will try to double click that error hope I could get some help.
|
|
|
|
|
It error is Unknown Name and object expected.
|
|
|
|
|
Does it give you a line number?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
I removed the javscript function now it is giving only one error saying object expected on line 1.
|
|
|
|
|
What do you mean you removed the function? please post the updated code.
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
|
have you posted the most up-to-date source?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
I know but I cant help its not working on my IE.Is it because i am using another 2 event for the same textbox (onFocus and onBlur)???
|
|
|
|
|
Can you repost the code you are using?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
wait... try onkeydown
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
You are using evt and event. The evt object is null in IE6. Try this:
function isNumberKey(evt)
{
if(!evt) evt = event;
var charCode = (evt.which) ? evt.which : evt.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
Wout Louwers
|
|
|
|
|
Does he not pass the event to the function?
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
In IE(6) an event function does not receive any parameters.
Wout Louwers
|
|
|
|
|
gotcha
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hi,
Anyone knows how the Yahoo Mail Beta does the File Upload technically? It is clear that it does not use FileUpload control from ASP.NET 2.0 for sure or HtmlInputFile HTML control.
Thanks,
Capricron
|
|
|
|
|
One would imagine that Yahoo is not using ASP.NET for its its mail beta (or indeed any of its sites)....although I could always be wrong.
|
|
|
|