Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Input Validation with Java Script

Posted on 2000-03-27
7
Medium Priority
?
284 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 90 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

972 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