Focal Point
[SOLVED] Javascript validation with autoprompt features

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7151077331

March 29, 2004, 05:13 PM
<Joe Filtz>
[SOLVED] Javascript validation with autoprompt features
Greetings:

WebFocus 5.2.3 with Oracle backend

I have a simple report that I have created using procedure viewer. We have used the autoprompt feature to prompt for two variables - customer name and output device (html, pdf, excel97)

The report accessess one table and displays the customer history of orders for that particular customer.

We have a business requirement that when entering the customer name, the user must enter at least three characters before the submit button calls the report.

I have done the following based on some stuff that I have read in the documentation.

1) Created a separate html form that has the javascript in it.
2) The separate html form then calls the focus procedure.

I have two problems with this scenario

1) The html form prompts for the customer name - the javascript works fine. However, when I call the .fex, the output device autopromptcomes up, making the user enter the device at that point.
2) Every report where I will want to do some kind of data validation on will require a separate html form.

What I am looking for is a way to combine JavaScript with the autoprompt features so that my users have one screen where the data is entered and validated.

Thanks in advance

Joe Filtz

This message has been edited. Last edited by: Kerry,
March 29, 2004, 08:18 PM
susannah
joe,make sure both of your &variables are requested in your single html launch page.
March 31, 2004, 01:58 PM
<Joe Filtz>
Susannah:

Thanks for the reply. Relatively new to WebFocus but I was hoping to avoid having to create a separate HTML form to do this.

1) Is there a way of using AutoPrompt and Javascript together without creating a separate form

2) If I have to create a 'launch' form, is there a way of stealing the code from AutoPrompt and just including it in the launch form. For example, my two variables will be customer name and output device. The output device will be Excel, HTML and PDF. Will I need to code that in the html launch pad or can I just grab it from someplace else

If I have to use a launch form and put all of my javascript in there, I am ok.

Thanks in advance

Joe
March 31, 2004, 04:03 PM
Bob Jude Ferrante
Joe--
Autoprompt already has a hook to a validation library called ibiValidate. It checks to make sure any cast parameters are input according to the rules of how they are cast. If you default an amper to be I11, and the user enters alpha characters, they get a message telling them that, and they can't submit the form until they fix that.

You can extend autoprompt by editing the wfdescribe.xsl file to add your own javascript validation library instead of the default, or in addition to the default. You will need to know how to do javaScript validation to write that library, though.

Hope this helps.
November 12, 2008, 03:50 PM
Mager
I am looking though for information.
Does this mean that autoprompt can be extended to custom pages and we can prevent a user from not entering a date before running a long IT job??


7.7.04
Windows and z/OS
PDF
Excel
Active
November 12, 2008, 04:34 PM
Darin Lee
No. Autoprompt is one way of entering parameters and custom pages are another. They don't intersect. If you are creating a custom page, you have to do all of your own validation to make sure necessary parameters are populated. However, in my opinion, custom pages are the way to go because you have COMPLETE control over what the user sees and does as opposed to autoprompting where you just throw some parameters out there and hope for the best.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat