How to submit page by hitting "enter" in a text field - Solution

Hi,
I had this problem yesterday and thought it may come in handy for others who run into the same issue.
My page had 2 text fields. Upon hitting enter in either of the boxes I wanted the page to submit. When only 1 text field was present it worked, however once the second field was added this stopped working.
After reading a bit (http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html) I fount that "When there is only one single-line text input field in a form, the user agent should accept Enter in that field as a request to submit the form.". This would explain why it worked with only 1 field, but not with 2.
After doing some testing I found that to make it work with 2 or more text fields, I needed to add a submit button. This is not the same as a button in APEX. In APEX "button" just has a onClick call to a submit function. You need a native HTML submit button.
In order to do that I created text field. Deleted the label, and set the static value to "Search" (this was for my search application). In the page attributes I added the following:
< script language="JavaScript1.1" type="text/javascript">
document.getElementById("P1_SEARCH_SUBMIT").type="submit";
< / script >
Note: I added extra spaces in the tags so they would display properly.
This function changes the button type to submit.
Now when I have 2 or more text forms it submits when I hit enter in either one.
Martin

Hi,
Set the Source Used: Only when current value in session state is null in Edit Page Item.
Regards,
Kartik Patel
http://patelkartik.blogspot.com/
http://apex.oracle.com/pls/apex/f?p=9904351712:1

Similar Messages

  • How Can i send the data entered in Input text fields to e-mail?

    Iam Jennifer, Iam having a doubt in Flash, I hope that you
    are going to solve my problem, Iam taking 3 Static text fields as
    Name, Age and Country and besides each and every static text fields
    i have taken 3 input text fields with different instance names,
    when i enter my Name, Age and Country details in the input text
    fields and after entering those details if user clicks the submit
    button the data should be send to some mail address, is it possible
    Im not so good at action script, but i hope that any one can
    help me...
    Iam attaching the action script code also, please find the
    attachment below, the actions are given to button.
    Attach Code
    Btn.onPress = function ()
    mail_lv = new LoadVars();
    mail_lv.dummy1 = "";
    mail_lv.subject = "Details";
    mail_lv.message = "hi";
    mail_lv.username = "name_txt".text;
    mail_lv.age = "age_txt".text;
    mail_lv.country = "country_txt".text;
    mail_lv.onLoad = function ()
    trace("Sent successfully...");
    trace("mail_lv.subject = " + mail_lv.subject);
    trace("mail_lv.message = " + mail_lv.message);
    mail_lv.send("mailto:[email protected]", "_blank");

    The names of your variables, "name_txt", for instance, should
    NOT have quotes around them. Use:
    mail_lv.username = name_txt.text;
    mail_lv.age = age_txt.text;
    mail_lv.country = country_txt.text;

  • How to add bullet on every enter event in text field

    Hello, Can someone please point me in the right direction. I am trying to add a bullet every time someone presses enter on the keyboard. this is within a textfield.
    Thank you,
    Howard

    Hi
    I would solve it by a script that checks your multiline field for newlines by ENTER key and insert "* " in the beginning of each line.
    1) create a multiline field in your form
    2) insert the script below in exit event... and enjoy the magic ;)
    just 7 lines of code without comments. The split function is very powerful, I really use it alot now!
    ===== script start =====
    //value of the field to insert "* " in each line
    var sFldValue = this.rawValue;
    //you split text in field for each '\r' = newLines made with enter
    var tmpFldArray = sFldValue.split("\r");
    //tmp string you concat your out text in
    var sOutStr = "";
    //for each line of text insert '* ' in beginning
    for(var i = 0; i < tmpFldArray.length; i++){
    //need to add '\r' because split removed it
    sOutStr += "* " + tmpFldArray[i] + "\r";
    //return manipulated string to your field
    this.rawValue = sOutStr;
    ===== script end =====
    /Thomas Groenbaek
    Jyske Bank
    Denmark

  • OAF PO Page Entry - User enter value in particular field  - Then want to check it should be unique othewise Message

    OAF PO Page Entry - User enter value in particular field  - Then want to check it should be unique othewise Message must be displayed so that user will select the non unique value in the entry filed. Please let me know will it be possible using personalization? Or I have to customize the controller extend it?

    Hahaha..
    Every tools have its own pros and cons.. There are much more things which you do in OAF (which is a web based solution) which you can't even imagine in Forms
    Cheers
    AJ

  • How to give error message for the screen element text field when wrong i/p

    How to give error message for the screen element text field when wrong i/p
    when wrong input given
    eg. 
    I have a text box with SBOOK-CARRID
    so when user give wrong entry in text box i.e LG
    then I should give some error stating that the the input is invalid or not available ,
    now it showing the error of standard messages,
    i want manual message to be displayed when error comes.
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    Hi all,
    Thank you for your valuable reply,
    but the thing is that its a screen field,
    i.e text box not a selection screen
    i created in screen layout
    with name sbook-carrid
    now i want to get error message display if wrong i/p is given
    thank you.
    Regards,
    Jagrut bharatkumar Shukla,

  • Why can't I load a page by hitting enter after I type it into the location bar? I have to click on the green arrow to load new pages.

    When I type a URL into the location bar, I have to click on the green arrow at the right end of the location bar for the new page to load. In previous versions of Firefox you just hit enter to load the new page.

    This didn't help my problem. When I restart Firefox in Safe Mode, the problem goes away but none of the other troubleshooting tips help. I noticed today that when I start Firefox in normal mode, I get this error: "TypeError: Components.classes[cid] is undefined." It's a Javascript error, and I also noticed that when I go to the Gmail page in normal mode the cursor isn't automatically placed in the username field like usual. When I start Firefox in safe mode it does this, however.

  • How does one replace carriage returns (enter key) in text areas

    I have an address text area in one of my pages where end users are hitting enter after each part of the address. I want to replace the carriage return hex('0A') with spaces. How can I do that?

    If you're manually saving your data, you can just change your insert/update code as below:
    insert into myTable
    (myCol)
    values
    (replace(:PXX_MY_TEXT_AREA, Chr(10), ' '))
    where ...If you're building a page where you aren't directly saving your data, you can add an "on Submit/Before Computation" process that does something like:
    :PXX_MY_TEXT_AREA := replace(:PXX_MY_TEXT_AREA, Chr(10), ' ');

  • How to restrict user to must enter value in compulsory fields

    Greetings !
    I had a personal information form. I want to restrict user to enter values in all fields e.g Compulsory fields (Username, D.O.B etc)
    how i restrict user to must enter value in Compulsory fields

    I created an example on apex.oracle.com
    http://apex.oracle.com/pls/apex/f?p=18686:1:0:::::
    like you see a red staric placed on ID it means it is complusory to enter because it is a primary key, i want this on every field or to restrict user to enter all data , if any field left blank it will give error "to Fill respective field ", but not on creation but on left blank (if user type ID e.g 12 and skip ename field and go on Job field it gives error to fill Ename first)

  • How to restrict Date field entered in a text field should be of MM/dd/yyyy

    Hi,
    I have an text field for Date entry,the Date format is MM/dd/yyyy,while entering the value i want to verify wether the values entered are valid or not,like month should n't be more than 12,date value depends on month should not exceed 30,31 or 28,year should not exceed 9999 like,if not possible at the time of entery i want to stop at least before submission.Right now i am traing to use my own model which extends PlainDocument calss,
    as in the fallowing way.But i t could not stop me to enter the wrong values ,Any help would be appreciated.
    mport javax.swing.text.PlainDocument;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.Document;
    import javax.swing.text.BadLocationException;
    import java.awt.Toolkit;
    * Insert the type's description here.
    * Creation date: (11/26/2001 6:22:14 PM)
    * @author: Administrator
    class DateFormatDocument extends javax.swing.text.PlainDocument {
    * DateFormatDocument constructor comment.
    String sInputMask;     DateFormatDocument(){
    //     sInputMask="MM/dd/yyyy";
              sInputMask="09/30/2000";
    try{
    //     insertString(0,"MM/dd/yyyy",null);
         insertString(0,"09/30/2000",null);
         }catch(BadLocationException ex){System.err.println(ex);}
    public void insertString(int offs,String str,AttributeSet a) throws BadLocationException{
         String sText=super.getText(0,getLength());
         if(sText.length()==0)
              super.insertString(offs,str,a);
              return;
         int len=str.length();
         String sText1 = super.getText(0,2);String sText2 = super.getText(3,5);String sText3 = super.getText(6,10);
         int str1=Integer.parseInt(sText1);int str2=Integer.parseInt(sText2);int str3=Integer.parseInt(sText3);
    //     System.out.println("str1:"+str1);
         if(offs<2 && str1<=12){
         if(len<=2){
                   super.remove(offs,len);
                   super.insertString(offs,str,a);
         else if(offs==2){
              super.remove(offs,1);
              super.insertString(offs,"/",a);
         else if(offs<5 && str2<=30){
              if(len<=2){
                   super.remove(offs,len);
                   super.insertString(offs,str,a);
         else if(offs==5)
              super.remove(offs,1);
              super.insertString(offs,"/",a);
         else if(offs<10 && str3<=9999 ){
              if(len<=4){
                   super.remove(offs,len);
                   super.insertString(offs,str,a);
         else{
              System.err.println("Beep!");
              //Toolkit.beep();
    public void remove(int offs,int len) throws BadLocationException{
         System.err.println(offs + " " + len);
         if(offs<2){
              if(len==1){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
              else if(len==2){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
         else if(offs==2){
              //do nothing
         else if(offs<5){
              if(len==1){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
              else if(len==2){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
         else if(offs<10){
              if(len==1){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
              else if(len==2){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
              else if(len==3){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
              else if(len==4){
                   super.remove(offs,len);
                   super.insertString(offs," ",null);
    }

    <code>
    mport javax.swing.text.PlainDocument;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.Document;
    import javax.swing.text.BadLocationException;
    import java.awt.Toolkit;
    * Insert the type's description here.
    * Creation date: (11/26/2001 6:22:14 PM)
    * @author: Administrator
    class DateFormatDocument extends javax.swing.text.PlainDocument {
    * DateFormatDocument constructor comment.
    String sInputMask; DateFormatDocument(){
    // sInputMask="MM/dd/yyyy";
    sInputMask="09/30/2000";
    try{
    // insertString(0,"MM/dd/yyyy",null);
    insertString(0,"09/30/2000",null);
    }catch(BadLocationException ex){System.err.println(ex);}
    public void insertString(int offs,String str,AttributeSet a) throws BadLocationException{
    String sText=super.getText(0,getLength());
    if(sText.length()==0)
    super.insertString(offs,str,a);
    return;
    int len=str.length();
    String sText1 = super.getText(0,2);String sText2 = super.getText(3,5);String sText3 = super.getText(6,10);
    int str1=Integer.parseInt(sText1);int str2=Integer.parseInt(sText2);int str3=Integer.parseInt(sText3);
    // System.out.println("str1:"+str1);
    if(offs<2 && str1<=12){
    if(len<=2){
    super.remove(offs,len);
    super.insertString(offs,str,a);
    else if(offs==2){
    super.remove(offs,1);
    super.insertString(offs,"/",a);
    else if(offs<5 && str2<=30){
    if(len<=2){
    super.remove(offs,len);
    super.insertString(offs,str,a);
    else if(offs==5)
    super.remove(offs,1);
    super.insertString(offs,"/",a);
    else if(offs<10 && str3<=9999 ){
    if(len<=4){
    super.remove(offs,len);
    super.insertString(offs,str,a);
    else{
    System.err.println("Beep!");
    //Toolkit.beep();
    public void remove(int offs,int len) throws BadLocationException{
    System.err.println(offs + " " + len);
    if(offs<2){
    if(len==1){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    else if(len==2){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    else if(offs==2){
    //do nothing
    else if(offs<5){
    if(len==1){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    else if(len==2){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    else if(offs<10){
    if(len==1){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    else if(len==2){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    else if(len==3){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    else if(len==4){
    super.remove(offs,len);
    super.insertString(offs," ",null);
    </code>

  • How do I add a new page dynamically base on the expendable text field?

    Hi, All,
    I've created a form with flow subform and expendable text fields. When the user fills out lengthy content, the form get cut off. Is there a way to dynamically add pages base on the content that user fills in the expendable text field?
    Thanks,

    May be you need check some things..
    1) See if the form is saved as Dynamic PDF form.
    2) The TextField should be set the "Expand to Fit" Check box checked in the Height property.
    3) The subform that contains the TextField should set to Auto Fit for Height.
    Thanks
    Srini

  • Query a view w/data entered into a text field populated by 2 table fields

    Hello, Looking for advise!!! I have a tabular canvas thats datablock uses a view to populate. In this canvas I have a text field that has been populated with first_name || ' ' || last_name in the database node of the property pallate column name. The text field is not in the table or view. I have created it in the data block and make it a database item. However, I would like to have the user push a search button to go into ENTER_QUERY mode then the user would enter the criteria to search on in this text field. The user would then push button to EXECUTE_QUERY. The result is I retrieve all records. I want any search criteria entered into this field to be used against the last_name field to retrieve any records equal to the search criteria entered, for example A%. Does anyone know if this is possible?

    Hi!
    You have to use PRE-QUERY trigger to compose the search criteria. Below I put an example of it. You have to have at least one item in the block wich is true database item (e.g. it has to exist in table or view on which your block is based). In the following example EMP_DESC is your non-database search item and EMP_ID is the database one.
    Declare
    Dummy VARCHAR2 (2000);
    begin
    if :EMP.EMP_DESC IS NOT NULL and :EMP.EMP_ID IS NULL
    then
    Dummy := '#IN (SELECT emp_id FROM Employees WHERE Upper (emp_first_name)||'' ''||Upper (emp_sec_name) LIKE Upper (''%'||:EMP.EMP_DESC||'%''))';
    Copy (Dummy, 'EMP.EMP_ID');
    end if;
    end;
    Thats it. Note the # sign in the first position of the Dummy assignment. This is required by forms to glue your search criteria and block's where clause. You may analize LAST_QUERY property of your block in order to understand how this work. Remember also to set the QUERY_LENGTH property of the EMP_DESC item to the value that could contain the whole Dummy string (otherwise it will give you an error and cut the mar the query).
    Hope this helps.
    Sergey.
    P.S. And set your EMP_DESC database item property to NO.

  • How to create a pdf/a-1b with a text field

    hello, I'm trying to execute a very simple task: create a pdf/a-1b containig a text field.
    using Acrobat XI pro, I created a simple pdf form with 1 form field of type text , then tried to save as pdf/A-1b. The pdf is saved but the form field is removed from resulting pdf.
    Here in detail the steps I made:
    0) configure adobe pdf printer to save as pdf/A-1b
    1) creat a test.txt with notepad
    2) print using acrobat pdf printer
    3) open the generated pdf with Acrobat XI
    4) in 'Standards' panel I see that pdf conform
    5) now go to 'Tools\Modules' and 'Modify'
    6) add a textbox field
    7) exit from 'Modify' mode and save
    8) in 'Standards' panel I see that pdf doesn't conform.
    9) I opened the preflight tool and see two errors
         a) "XMP property for a page object not predefined and no extension schema present".
         page reports the following Trigger values:
         - Extension schema is present in XMP: is not true
         - Property exists in PDF/A Standard: is not true
         b) Form field does not have an appearance dictionary
         page reports the following Trigger values:
         - Form field has an appearance dictionary: is not true
    I'm quite new to Acrobat: simply downloaded the Actobat XI evaluation version, created the file and added the text field. No special settings nor other configurations was applied,
    I'm wondering if someone else was able to reproduce this behavior.
    thank you for any comment

    First, about invalidating the PDF/A. I was told, but never had this confirmed nor tested, that editing a PDF/A will automatically cause the PDF/A status to be deleted from the file. This is because Acrobat does not know about the compatibility of every edit with every current (and future) PDF subset standard, so it is safest just to remove the indicator - if you turn off Adobe's PDF/A view mode which will prevent editing anyway.
    Now, you have a problem with the signatures. Possibly a very big one. Your description "2) fill the text field with some annotations and then sign the signature field 3) save the pdf" is a little too separated. At the time a file is signed it is saved, the hash calculated, and written to the file. So signing and saving are just one action. Yet an unsigned digital signature needs, it seems to me, no appearance.
    I think the solution is a simple one. Sign it, but not with a signature field. If it is PDF/A when you start it is probably PDF/A when you finish. Signature fields seem a distraction and obstacle to the important thing, signing.

  • How do I embed multiple font outlines in dynamic text field

    Can anyone tell me how I can embed multiple font outlines in
    Flash MX so I can get smooth text in a dynamic
    text frame? I want to use Regular, bold and italic in various
    parts of the text.
    I was using the Character button in the properties manager
    and tried to include all Characters. That does not work.
    In the Properties manager I can choose Bold and/or Italic.
    But it becomes a universal setting that overrides my HTML tags in
    my external txt file that I am importing. I dont want all my text
    to be bold.
    If I dont select them in the properties, however, Flash will
    not embed the font that it needs.
    Is there a different way to embed fonts other than under the
    Character Tab?
    I tried to import fonts to the library, but can not select
    them.
    Your help would really be appreciated.
    Sincerely,
    ggaarde

    ggaarde wrote:
    > Thanks Urami
    > Tried your method and it does not work for me.
    > I put 3 dynamic text fields in the first frame of the
    movie. Set them up to
    > where one is regular, one is bold and one is italic
    Helvetica.
    Weird, it works for me on first go, always had in fact :)
    Show you an example, try to compare to your file see if you
    missed anything accidentally.
    http://flashfugitive.com/stuff/font/text.swf
    text file
    http://flashfugitive.com/stuff/font/text.txt
    fla
    http://flashfugitive.com/stuff/font/text.fla
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How does one change a "rollover" value in a text field of a fillable PDF?

    I have a fillable PDF, and the values displayed when rolling the pointer over a fillable text field are showing some strange values.  I inherited this form from someone who is no longer with the company.  I need to be able to change the values but can't figure out how.  I'm new to LiveCycle so any help is greatly appreciated.

    When you click on the field, right click to properties.  If the tab isn't there then go to the top toolbar, click on Window and it should appear in the list there.  Once you click on it in the Window menu it will appear as a tab on your properties box.

  • ADF Mobile: How to change the font size of an Input Text field in .amx view

    Is there a way to change the font size of the input data (not the label) in a text field? Changing the font size in the Style Font/Text settings doesn't seem to do anything for the label or the value in the input text field. Is this a bug or is there a way to get this to work?

    Hi Anna,
    depending on the UI element there are a range of ways. (and I'm sure people will post plenty of answers to tell you how).
    However, if generically the fonts in you portal/wd applications are too small, you should consider changing your theme so as to have larger texts. Otherwise you will either need to customise all your applications, or you will get quite a lot of inconsistency of presentation between your various WDA applications.
    Do a search on "themes for Web Dynpro ABAP" and you'll find loads of resources.
    Hope this helps,
    Cheers,
    Chris

Maybe you are looking for