Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form processed when pressing Enter

Posted on 2000-05-05
8
Medium Priority
?
266 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
[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
  • 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
Industry Leaders: 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!

 

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 90 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

704 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