Solved

Enter key press opens a new window

Posted on 2006-06-23
6
484 Views
Last Modified: 2008-01-09
Hi

I found a strange behaviour for input boxes inside a modal window. I am opening a popup using modal window. Inside this window I have input boxes. For this boxes I have written special chars validations on keypress. But when I press ENTER key it does not validate but opens the same file inside a new window. Is it a bug??
0
Comment
Question by:gops1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 30

Expert Comment

by:callrs
ID: 16974071
Say your validation function is called "Form_Validator". Then put this statement in your form tag:
onsubmit="return Form_Validator(this)"

Here's an example from someone's site:
<form action="../_vti_bin/shtml.dll/modulo.htm" method="POST" name="FrontPage_Form1" language="JavaScript" onsubmit="return FrontPage_Form1_Validator(this)">

-------
Now, in your validation function, return false to not submit the form (e.g. if user has made an error), or true to submit the form (if user input is OK).

---
Make sure your input boxes are enclosed in  these tags: <form onsubmit=...> ... </form>
0
 
LVL 17

Author Comment

by:gops1
ID: 16974302
This happens only when I call the page inside a ModalWindow. Just to check I created a sample modal window with a input box and there too it behaves the same
0
 
LVL 7

Accepted Solution

by:
pradeepsudharsan earned 125 total points
ID: 16974903
     <base target="_self">
add this code in your page
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 17

Author Comment

by:gops1
ID: 16975158
But I am not redirecting anywhere. Would like to know why this behaviour
0
 
LVL 17

Author Comment

by:gops1
ID: 17416559
Since I could not get what I expected, I am closing this query. But anyways thanks a lot for the effort you all have put to help me out.
0
 
LVL 30

Expert Comment

by:callrs
ID: 17441714
If you post enough code to allows us to re-create the problem, then there's better change that we can fix it.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question