Solved

Input Validation with Java Script

Posted on 2000-03-27
7
278 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
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

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

Suggested Solutions

Title # Comments Views Activity
Word Pro Conversion utility 13 34
Lotus notes VB code 4 208
Lotus Notes: Email Delivery Failure 5 169
Domino Lotusscript Scheduled Agent Tranfer File from AS400 to another 6 113
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
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

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