Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

don't save on [Enter] in web form 1

Status
Not open for further replies.

DerStephan

Programmer
Aug 19, 2003
54
DE
hello

I have a webform withmy own submit button that checks the form, then saves the document and after this directs to a page ok or error

it runs well

it findas error s and then gets me to the right page but the problem is when someone presses enter while writing in a text field. notes just saves the docuemtn as it is and displays the message "form processed"

how can i supress that notes catches the enter

an event OnPressEnter would be nice ;)

regards

Stephan
 
You've got onKeyPress, just put some code in there to examine event.keyCode. if event.keyCode == 13 then do nothing (return false) otherwise do the normal operation (return true)

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
hi dwarthrower

I have never seen before any java,
so where to get the event object, and how to return sth.

I have only some little experiences on LotusScript but I think It won't be the same, or?

thanks in advance


Stephan
 
No, JavaScript and LotusScript are different. On your form there is a JavaScript event handler called onKeyPress. If you add the following code:
Code:
return(event.keyCode!=13)
The browser will check to see if the key pressed was enter and do nothing if the enter key was pressed, all other keys will function normally.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Life can be so simple.....


Thank you so much dwarthrower

Stephan
 
or just add a hidden SaveOptions field with the value "0"



Woonjas
IRC: #notes on EFNet
 
Another way is to validate the form onClick of the submit button.

Fight?
[lightsaber]
What fight? [shocked]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top