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
Solved

Form processed when pressing Enter

Posted on 2000-05-05
8
261 Views
Last Modified: 2013-12-18
I have some forms with just one editable field. The form is processed  if you
 hit 'enter.' (form processed).

I need the user press the ok button to submit the form. How avoid to process the form just pressing enter in the editable field? If two or more editable field are defined in the form nothing happens, but I can't show more editable fields and the type=hidden fields don't work.

Thanks.
0
Comment
Question by:perevicente
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:snocross
ID: 2780805
Do you have an OK button AND a SUBMIT button?  Is your OK button an action button or a button on the form?
0
 

Author Comment

by:perevicente
ID: 2780912
I just have one OK button an it is an action button
0
 
LVL 5

Expert Comment

by:snocross
ID: 2781018
When you press enter the browser is looking for the first button on the form.  Since there isn't one (other than the action button) it does a regular old SUBMIT.  If you put your OK button on the form instead of using the action button it should work.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:perevicente
ID: 2781244
My form is full of buttons (html and action). I'm hidding or showing some fields,data and buttons denpending on the sequence I'm in the workfolw (the form is never saved).

The last step of the action shows a editable field (password field) and two buttons: OK and cancel. The first one is an html button and the other one is anaction button.

The OK one lunck a onclik event.

the form has no onsubmit event.

When I try what you say (I define a button before the OK button) the form is still submited.
0
 
LVL 5

Expert Comment

by:snocross
ID: 2781356
snocross changed the proposed answer to a comment
0
 
LVL 5

Accepted Solution

by:
snocross earned 30 total points
ID: 2781377
Try this:

1. Add a hidden editable field called "Flag" to the form with the following Input Validation Formula:

@If(Flag="";@Failure("You must click the Submit button to save");@Success)

Then change the formula in the Submit button to the following:

Field Flag:="OK";
Field Status:="Saved";
@Command([FileSave]);
@Command([FileCloseWindow])
0
 
LVL 3

Expert Comment

by:Simon_Hendry
ID: 2786695
If your using R5 then you can specify the onSubmit Event to be

return Never()


and the JSHeader to be

function Never()
{
alert('You must press the OK button to submit this data');
return false;
}


That way when the form is submitted via a SUBMIT Button or by the user pressing enter in an editable field the form will do nothing... I assume that your OK button is of type BUTTON not of type SUBMIT..

You can do the same in R4 but its a lot more fiddly...

0
 

Author Comment

by:perevicente
ID: 2963618
Thanks, I think  I can manage it
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LOtus Notes 6.5 low performance 13 38
Notes 8.5.2 application on web 4 215
Lotus Notes - Broken Links report 5 218
Event in Notes Form after open and visible 10 222
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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