Solved

Input Validation with Java Script

Posted on 2000-03-27
7
280 Views
Last Modified: 2013-12-18
Hi experts,

in my web-application I have a form with a field that is checked for it is empty or not. I check this field over a Java-Script with the onSubmit Event on the form. Furthermore I have a Save and a Close (Action Button). The problem is that the onSubmit Event runs before the Lotus Formula in the Close Button. That means the field is also checked if I click the Close Button. Should I take another event or must I solve this by a completely another way. What is the best way in a web-application to make a input validation ?
Over Java Script Lotus Script or something else ? Can someone give me an exaple ?

Thanks a lot Tom
0
Comment
Question by:woodlott
[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
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

by:woodlott
ID: 2663103
Adjusted points from 20 to 30
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 30 total points
ID: 2673501
Hi

This can be done very easily by using Notes Formula language and JS.

But for that you may have to incorporate a javascript header on top of the form

Here is the technique.

1. Write the following passthru HTML

<Script Language="Javascript">
[--Field "Alert", Computed For Display, Formula:Alert--]
</Script>

2. In the Submit/Close button use this formula,


@If( @Trim(FIELD1) = "" ; @Do( @SetField("Alert";  "alert(\' ERROR: Unable to complete the submit process \\n REASON: One or more required fields marked by * are null ! \')"); @Return(0) ); @Do(@Command([FileSave]);@Command([FileCloseWindow])) )



Good Luck
~Hemanth
0
 
LVL 5

Expert Comment

by:snocross
ID: 2751536
Hi, this URL will show you how to combine Javascript with Notes actions.  I think you will find it very helpful for what you are trying to do.
0
Independent Software Vendors: 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!

 
LVL 5

Expert Comment

by:snocross
ID: 2751542
0
 

Author Comment

by:woodlott
ID: 2758377
Thank you Hemanth,

first I forgot to say that I use Release 5, but I think it will be make the problems more less. I don't know how I make the first point. What I must I write in the JS Header event on the Form. I don't understand the line

[--Field "Alert", Computed For Display, Formula:Alert--]
and
1. Write the following passthru HTML

hope you can help me onesmore

Thanks
Tom
 
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2762374
Hi Tom

I am sorry for being so cryptic, Ok

[--Field "Alert", Computed For Display, Formula:Alert--]

means

Create a field named alert and set it as computed for display and default value as alert.

once you create this on the top of the form, block the test and make it as passthru html from text menu.

Your javascipt looks similar to this

<Script Language="Javascript">
[Alert]
</Script>

~Hemanth
0
 

Author Comment

by:woodlott
ID: 2780883
Thank you Hemanth,

your formula works great, but I don't understand the function of the JavaScript. The Validation works also witzout the Script in the top of the form.
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
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…

730 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