Pressing Enter key twice should submit the form
I am trying to enter the chinese characters in the text box, chinese chracters will become a whole word only when we press the Enter key. But after entering a chinese character , if I press the enter key then the form got submitted. Instead the form should get submitted only when we press Enter key for the second time.
Is it possible with Javascript?
karthi23 wrote:
I am trying to enter the chinese characters in the text box ...Where? An Java application? Your browser?
Is it possible with Javascript?This is a Java forum. JavaScript and Java are two completely different things. You better find a JavaScript forum to ask this question.
Similar Messages
-
How to submit a form by pressing enter key
Hi,
I'm having a problem..............i have a form having text field and a button created using struts html tags..........when user enters the value and presses the button then the value is being taken...........
but if the user enters the data and just presses enter key the form refreshaes but value is not submitted.............
the button is created using <html:submit >tag.............can any one pls help me out with this???????????<script language="JavaScript">
<!--
var isNav, isIE
if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == "Netscape")
isNav = true
else
isIE = true
function showKeyValue(evt) {
var keyValue
if (isNav)
keyValue = evt.which
else
keyValue = window.event.keyCode
/*status = keyValue*/
if (keyValue == 13) {
javascript:validateForm();
return false
</script>
in the field call this method
onKeyPress="showKeyValue(event)" -
How can i select the next column instead of next row when press enter key
I need to know how can i select the next column instead of next row when i press the enter key.By default ,when i press enter key the next row is selected and the column remain unchanged but I wants opposite that is the row should remain unchanged but column index will changed.
Thanks to all.Well, the right arrow key will already move you to the next column, so the easiest way to do this is to modify the InputMap to have the Enter key invoke the same Action as the right arrow key.
You can search the forum for my "Table Actions" (without the space) example that will show you how to do this. -
Clearing the TextArea texts when I press Enter key
How to clear the texts that I have typed into the TextArea when I press Enter Key?
I have now added a TextArea instance called input_txt to the stage and added an component event listener to detect when I press enter key. Then an event fires up which first reads the input to a string variable.
But next I need to automatically clear the texts in the TextArea.
How to do that?
function readInput(event:Event):void
input = input_txt.text;
trace(input);
// removing texts in the text input area-------- how?
input_txt.addEventListener(ComponentEvent.ENTER, readInput);
Please help.
Thank YouComponentEvent.ENTER occurs before the line feed is added to the text, and is not cancelable, so you'll probably need to set a flag and do the clearing in an Event.CHANGE handler. Something like this:
import fl.events.ComponentEvent;
input_text.addEventListener(ComponentEvent.ENTER, readInput);
input_text.addEventListener(Event.CHANGE, changeHandler);
var clearing:Boolean=false;
function readInput(event:Event):void
input = input_txt.text;
trace(input);
clearing=true;
function changeHandler(event:Event)
if(clearing)
input_text.text="";
clearing=false; -
In the address bar where type the address of the web site at the top. after entering the address i press enter key from the keyboard but it doesn't work there . Means the page is not navigating towards the address. Kindly solve the problem
This issue can be caused by an extension that isn't working properly.
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
* Don't make any changes on the Safe mode start window.
* https://support.mozilla.com/kb/Safe+Mode
* [[Troubleshooting extensions and themes]]
In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
* Help > Restart with Add-ons Disabled
* Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows) -
Execute (F8) taking place upon pressing 'Enter' key
Hi,
I have developed two custom screens in separate programs. The second screen has been assigned a transaction code and is called from the first screen upon user command. Input in screen 1 is in the form of an IO field that takes two-character codes. The appropriate transaction is called depending on the value of the code input by the user.
Before the second program is called (using call transaction statement), inputs are error checked using input checking modules. Pressing the enter key does not cause the second program to be called, which is as it should be. Only upon execution (F8) is the second program called. Once the second program has been called and exited (using leave program statement) it goes back to the first program (screen). This is alright. The issue is that now when the enter key is pressed, the transaction for the second program is called again. I don't want this to happen. This should happen only upon execute, not from pressing Enter. If I input a different value in the input field at this point then press enter it doesn't execute, which is ok. The issue I have described occurs only in the case of calling a transaction, exiting the second screen which is called (which takes you back to the first screen) and pressing Enter.
My code:
TABLES: ZSH_PROCS.
Global data declarations.
DATA: OK_CODE LIKE SY-UCOMM,
PROC_INFO LIKE ZSH_PROCS,
PROC_INPUT TYPE ZSH_DE_PN.
Screen fields - Used in screen: '9500'.
DATA: TBX_PROCESS TYPE ZSH_DE_PN,
LBL_PROC_STXT TYPE ZSH_DE_PD.
Modules
MODULE INIT_9500 OUTPUT.
SET PF-STATUS 'ZSH_GUIS_MAIN'.
SET TITLEBAR 'ZSH_TITL_MAIN'.
ENDMODULE.
MODULE EXIT_9500 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL' OR 'BTNEXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
MODULE PROC_CHECK_9500 INPUT.
PROC_INPUT = TBX_PROCESS.
TRANSLATE PROC_INPUT TO UPPER CASE.
SELECT SINGLE * FROM ZSH_PROCS INTO CORRESPONDING FIELDS OF
PROC_INFO WHERE PRNAM EQ
PROC_INPUT.
IF SY-SUBRC NE 0.
CLEAR: TBX_PROCESS,
LBL_PROC_STXT.
MESSAGE E008(ZSH_MSGC).
ELSE.
LBL_PROC_STXT = PROC_INFO-PDESC.
ENDIF.
ENDMODULE.
MODULE USER_COMMAND_9500 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'EXECUTE'.
CALL TRANSACTION PROC_INFO-TCODE.
ENDCASE.
Screen flow logic:
PROCESS BEFORE OUTPUT.
MODULE INIT_9500.
PROCESS AFTER INPUT.
MODULE EXIT_9500 AT EXIT-COMMAND.
CHAIN.
FIELD: TBX_PROCESS,
LBL_PROC_STXT.
MODULE PROC_CHECK_9500.
ENDCHAIN.
MODULE USER_COMMAND_9500.
Tha above code is for the first program (screen). Help is greatly appreciated. Thanks.
Regards
Edited by: Khan Awkhan on Jul 22, 2008 6:34 AMHi,
Clearing the ok_code should solve your problem.
Try this:
MODULE INIT_9500 OUTPUT.
SET PF-STATUS 'ZSH_GUIS_MAIN'.
SET TITLEBAR 'ZSH_TITL_MAIN'.
" Clearing the ok code
CLEAR OK_CODE.
ENDMODULE.
Regards,
Wajid Husssain P. -
Document addition on pressing Enter Key
Dear all,
I want to know whether it is possible to restrict document addition by pressing Enter Key at first time.
What i want is if user press enter key for first time to add document the system should generate message as generated in Invoice so that document is added after message.
This is because many users are use to legacy system where they regularly press enter which creats error in new system.
Is it possible ..??
swapThere is an add-on called B1UP.
It has so many cool features.
When you press enter it takes you to the line level and does not add the document.
Thanks,
Joel -
In an ADF Faces application is there a setting that allows a user to respond to a button by pressing the ENTER key instead of usering the mouse? Is this a browser function or an application function?
Dev env: JDeveloper 10.1.3.3.0.
TIA,
DaveThanks for the reply.
I checked the defaultCommand property of af:form and it has loginButton. The ID on the login button has loginButton1 but I'm not sure that is an issue because on some PC's the ENTER key works as expected.
I appreciate the clue though and will look further.
Dave -
Infopath cannot submit the form because it contains errors. Errors are marked with either a red asterik(required fields) or a red, dashed border (invalid values).
Press Ctrl+Shift+O for next error or Press Ctrl+Shift+I for error details
Please help me, Thank in advance.
Sravan.Hi Sravan, this means that one or more of the fields are required to be filled in or have validation set up on them so that the information entered matches a certain criteria. Make sure what's entered matches what's required. If the form still can't be
submitted, check the rules set in InfoPath and the list/library to see what's causing the error(s).
cameron rautmann -
Trigger PAI after pressing enter key
Hi all,
How to trigger the PAI event after pressing the enter key on the keyboard. i have a input field and a button on the screen. after entering the value into the field and pressing buttot will take to next screen. But if I press enter key the value is getting cleared. How to trigger the PAI event after pressing the enter key?
Thanks in advance,
Dev.Hi,
The keyboard event 'Enter' does not have a default sy-ucomm or a Function code associated with it.
So, whenever you press Enter, it triggers the PAI (sy-ucomm would be blank) and somewhere in your code the value is being refreshed. You can debug thoroughly to find where the problem is.
You can assign a Function code for Enter. Go to the GUI Status of the Screen -> Function Keys -> You will find a icon Enter (the one with the tick mark in a green circular background) -> Assign Function code like 'ENTER'.
Now in your PAI, restrict your code saying
if sy-ucomm = 'ENTER'.
"Logic
endif. -
How to get input values till pressing enter key
hi!!!
i need to enter values thru keyboard using bufer reader etc etc
but i need to stop entering when i press enter key
how to do this??First off I would take a look at this link because it gives quite a few good examples if you've never used scanner.
You can find all this on the link.-> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
in order to use scanner you have to import it.
import java.util.Scanner;then inside your main method you need to create a scanner wrapped around the keyboard inputstream.
Scanner userIn = new Scanner(System.in);take a look at the api to decide which method you want. For this I would suggest nextLine().
also I would specify that you want the numbers separated by spaces or comma's or something so you can use the String.split(" "); method which returns an array of Strings;
then traverse through the array of strings and convert them to ints
http://www.rgagnon.com/javadetails/java-0004.html -
Upon Pressing Enter Key in an InputField
Hi,
I have an InputField where i have to enter AirlineId and followed by search button
But my requirement here is <b>
We have to press Enter key in INputField.Then all the AirLineIds which are there in the database has to be popuped and in that the one which selects has to be placed in the InputField</b>
Regards
PadmaHi Padma,
Create a onEnter event for the input field & inside that create a modal window. For that window u have to create a view also.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/dialog%20boxes%20in%20web%20dynpro%20applications.pdf">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/dialog%20boxes%20in%20web%20dynpro%20applications.pdf</a>
In this tutorial check the code for AddressBook(not for external window) .U can use this code
IWDWindowInfo myWinInfo = wdComponentAPI.getComponentInfo().findInWindows("<window name>");
myPopupWindow = wdComponentAPI.getWindowManager().createWindow(myWinInfo,true);
myPopupWindow.setWindowPosition(300,150);
myPopupWindow.open();
regards
Sumit -
Can I execute a code on pressing Enter key?
Hi
I want to execute a piece of code on pressing Enter key, while in a datablock in Query mode
I tried KEY-ENTER trigger but nothing happens.
Is that possible?
Am I asking a nonsense thing?
Thanks in advance
Oscarno meaning to press enter in query mode. u can use buttons for directly running some other codes instead
Thanks & Best Regards
HuaMin
Please remember to always mark the reply if it's helpful or related to your issue! -
MODULE POOL WHEN WE PRESS ENTER KEY IN A TBL CONTROL THEN CURSOR GO TO FIRS
DEAR ALL,
IN MODULE POOL WHEN WE PRESS ENTER KEY IN A TBL CONTROL THEN CURSOR GO TO FIRST INPUT/OUTPUT BOX I WANT THE CURSOR WILL STAY ON THAT TBL CONTROL COLUMN.
PLZ TELL ME HOW I CAN DO THIS.
THANKS
SHASHI
Moderator message: no upper case please, search for available information before posting.
Edited by: Thomas Zloch on Mar 11, 2011 11:50 AMHi,
This is possible only for check boxes and radio buttons.
for others you atleast need to double click.
please note double click is possible.
regards
Ramchander Rao.Krishnamraju -
By pressing enter key on button?
By pressing ENTER key on key board on button(SUBMIT) how i get action perform.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class loginform {
public static void main(String a[]) {
loginform1 s = new loginform1();
s.setSize(800, 600);
s.setVisible(true);
class loginform1 extends JFrame implements ActionListener {
JTextField user;
JPasswordField pass;
JButton submit;
public loginform1() {
setLayout(null);
Container c = getContentPane();
JLabel JLabel1 = new JLabel("User Name:");
c.add(JLabel1);
JLabel1.setBounds(220, 205, 90, 20);
JLabel JLabel2 = new JLabel("Password:");
c.add(JLabel2);
JLabel2.setBounds(220, 245, 90, 20);
user = new JTextField();
c.add(user);
user.setBounds(300, 205, 130, 20);
setVisible(true);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
user.requestFocus();
pass = new JPasswordField();
c.add(pass);
pass.setBounds(300, 245, 130, 20);
submit = new JButton("Submit");
c.add(submit);
submit.setBounds(320, 290, 80, 20);
submit.addActionListener(this);
WindowListener l = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
addWindowListener(l);
public void actionPerformed(ActionEvent ae1) {
if (ae1.getSource() == submit) {
String s1 = user.getText();
String s2 = pass.getText();
System.out.println(s1);
System.out.println(s2);
}how to get that one.
thanks in advance
rajaadd this to loginform1's constructor
this.getRootPane().setDefaultButton(submit);
Maybe you are looking for
-
IPad mini backlight issues after digitizer replacement
I recently replaced the digitizer on my 1st gen iPad mini, and after reassembly, I'm havering issues with the backlight. Please have a look at my photo and let me know what the issue may be. Thanks a lot, Dave
-
Unexpected exception while copying binary to target
1st time i run linux app under SDK, it copy the .elf fine to the board, but when i try run the 2nd time it give me " Unexpected exception while copying binary to target" doesn't matter i reset/cycyle the power for the board.
-
Error in iSQLPlus configuration
Hi ALL I got the below error when I'm trying to connect. iSQL*Plus: Internal error (no valid library could be found) Could you please help me. Thanks in advance. Viral Dave null
-
I made a purchase of about 3 songs for the price of 5.16. Well when I was trying to download the songs a message kept appearing saying that "the account inforamtion does not match my bank records". Looking at my bank account 3 days later it shows up
-
I opened up youTube using a shortcut from the Cocoppa app last night, and the screen froze, my home button would not work, so I locked it. The phone was charging at the time and nowhere near dead. After I did so, I pressed the lock and the home butto