Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
JScripts on ASP.NET Master page?
Old 03-28-2007, 09:28 AM JScripts on ASP.NET Master page?
Novice Talker

Posts: 9
Trades: 0
Hello,
I have a question how to catch TAB key press with JScript (I can't use JavaScript on this page) on ASP.NET website??
Maybe someone had similar problem?
Thanks!

Hello,

I have a problem to use JScript (I can't use JavaScript) on ASP.NET masterpage.
when I use this script on ordinary ASP.NET page, it works ok.
How can I use script like this on master page?
<Script for="window" event="onload" language="jscript">
if(window.form.txtSomeTextBox.value == "")
{
window.form.txtSomeTextBox.focus();
}
</Script>
Thanks!

Wojtek
woojtii is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-30-2007, 04:23 AM Re: JScripts on ASP.NET Master page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I can't use JavaScript on this page
In that case you can't

jscript runs server side NOT client side.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-05-2007, 04:51 PM Re: JScripts on ASP.NET Master page?
Banned

Posts: 421
Location: Boston, MA
Trades: 1
try this function:
function suppress(e)
{
var key, keychar;
key = getkey(e);
if (key==13)
return false;
}

change
if (key==13) return false;
to do what you like to do 13 is for enter key, find the one for tab key.
webcosmo is offline
Reply With Quote
View Public Profile Visit webcosmo's homepage!
 
Old 04-05-2007, 04:55 PM Re: JScripts on ASP.NET Master page?
Banned

Posts: 421
Location: Boston, MA
Trades: 1
sorry its javascript. didn't see you cant use javascript. but you can use this on asp elements with OnKeyPress="return suppress(event);"
example:
<asp:textbox id="txtSearchKey" runat="server" OnKeyPress="return suppress(event);" />

example I gave you is to supress the enter key event. you may modify this for your need.
webcosmo is offline
Reply With Quote
View Public Profile Visit webcosmo's homepage!
 
Reply     « Reply to JScripts on ASP.NET Master page?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20382 seconds with 12 queries