Mark,
Yeah, that stuff is strange. I recently had an EasyListBox user
tell me that ELB was causing a problem with RichTextBox; it was a small
aberration, and nothing that threw an error, but of course I wanted to
fix it. Turns out there was one line where I set the offsetWidth of the
list, and for some reason, this was interfering with a delayed focus
command from RTB. I have no idea why this mattered, but when that
oneline was removed, RTB worked fine again. Very strange.
By the way, you can also go to
http://groups.yahoo.com/groups/AspNetClient for questions like these;
there are some really good client-side folks there, and they could use
the traffic!
Cheers,
Peter
-----Original Message-----
From: Mark E [mailto:[EMAIL PROTECTED]
Peter,
Must have been the "javascript:". Once I removed it, it worked fine.
What's strange is that I have done it that way about a dozen times w/o
an error.
Anyhow, thanks for the help.
Mark
Peter Brunone <[EMAIL PROTECTED]> wrote:
Hi Mark,
These may or may not be related to your problem, but I see a few
errors in your code below.
1) There is no semicolon after the first line of the function.
2) The indexOf() method returns an integer, not a string.
3) You don't need the "javascript:" pseudoprotocol in an event handler.
You should just have the function call.
That said, what line does it say throws the error?
Cheers,
Peter
-----Original Message-----
From: Mark E [mailto:[EMAIL PROTECTED]
All,
I have a javascript function that prevents users from entering
non-numeric values into a textbox.
I add the function to the onkeypress for the textbox in the code-behind
page.
When I press any key, I am getting an 'object expected' error.
Here is the line of code in the code-behind page that adds the function
call the textbox:
txtUnitPrice.Attributes.Add("onkeypress", "javascript:return
NumericOnly();")
And here is the javascript function:
function NumericOnly(){
var valid = "0123456789."
var testChar;
testChar = String.fromCharCode(event.keyCode);
if (valid.indexOf(testChar) == "-1") {
return false; }
else {
return true;
}
}
Doea anyone see what I am doing wrong?
Thanks,
Mark
[Non-text portions of this message have been removed]
Yahoo! Groups Links
Yahoo! Groups SponsorADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/