473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Enter Key Posts the Page

i am using a textbox and i need to popup a dialog on Enter Key, i have used
javaScript for it.The pop-up is coming but the page gets posted.I am using
asp:button to save the information in page.i have set tabindex and focus but
nothing is working,how to stop the page being posted, Is there any way, Help
me.

Thanks in Advance.

Prakash.V
Nov 19 '05 #1
2 1909
Have you tried cancelling the event in a cross browser manner?

Something like:
function DoSomething(e)
{
window.open(...);

if(navigator.appName == "Microsoft Internet Explorer")
{
event.returnValue=false;
event.cancelBubble=true;
else
{
e.preventDefault();
}
return false;
}

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Prakash" <vv********@gmail.com> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
i am using a textbox and i need to popup a dialog on Enter Key, i have
used
javaScript for it.The pop-up is coming but the page gets posted.I am using
asp:button to save the information in page.i have set tabindex and focus
but
nothing is working,how to stop the page being posted, Is there any way,
Help
me.

Thanks in Advance.

Prakash.V

Nov 19 '05 #2
Thanks,

your Solution worked fine for me.

Prakash.V
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Have you tried cancelling the event in a cross browser manner?

Something like:
function DoSomething(e)
{
window.open(...);

if(navigator.appName == "Microsoft Internet Explorer")
{
event.returnValue=false;
event.cancelBubble=true;
else
{
e.preventDefault();
}
return false;
}

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Prakash" <vv********@gmail.com> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
i am using a textbox and i need to popup a dialog on Enter Key, i have
used
javaScript for it.The pop-up is coming but the page gets posted.I am using asp:button to save the information in page.i have set tabindex and focus
but
nothing is working,how to stop the page being posted, Is there any way,
Help
me.

Thanks in Advance.

Prakash.V


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
3
by: Harry | last post by:
Hi all, I have a number of imagebuttons on a page and when the user enters data into a text field I would like for the page to submit. How would I do that? Currently, if the user hits Enter,...
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
5
by: TS | last post by:
for some reason, it posts to the server, but no click events of any buttons on form fire. the button is the first one on the form. when the focus is inside the textbox, it doesnt' work. if i click...
4
by: nkoier | last post by:
Hi, I've been going crazy trying to figure out what's wrong with our Asp.Net 2.0 intranet site. At the very top of our main page I provide a TextBox and a Button for submitting Google searches....
8
by: =?Utf-8?B?TGlzYUNvbnN1bHQ=?= | last post by:
I have a data entry application. Due to ease and location, the users utilizie the enter key to move from field to field, rather than the tab key. Depending on the data they enter into a field,...
39
by: emre esirik(hacettepe computer science and enginee | last post by:
int n_mines; printf("How many mines do you want in the minefield?"); scanf("%d", &n_mines); while(n_mines>100 || n_mines<0) { printf("Please only enter between 1 and 100"); scanf("%d",...
6
by: Mark B | last post by:
I have a function that looks up a SQL table to see if a search term matches. It works fine but so far there are two things yet to work: 1) After entering a search term and pressing Enter, nothing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.