Solved

Input Validation with Java Script

Posted on 2000-03-27
7
276 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
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

by:woodlott
Comment Utility
Adjusted points from 20 to 30
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 30 total points
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 5

Expert Comment

by:snocross
Comment Utility
0
 

Author Comment

by:woodlott
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

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
  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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now