Solved

Form processed when pressing Enter

Posted on 2000-05-05
8
260 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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