Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Javascript Validation Help needed.Very Very urgent!!
Go
New
Search
Notify
Tools
Reply
  
[CLOSED]Javascript Validation Help needed.Very Very urgent!!
 Login/Join
 
Guru
posted
Hi,

Iam using webfocus 8005 version and am stuck with this Javscript validation.Could anyone out there please help me to do this validation in javascript from the launchpage and this is really really very urgent for me.
1)I have a text box wherein the user can enter multiple employee ID's but cannot enter a manager ID and an employee ID at the same time and if they enter a manager ID and an employee ID at the same time,it should alert them with a message or throw an error.There is a table which fetches the manager and the employee relationship and from that table,we can determine which employee is reporting to which manager and there are over 2Lakh employee id's.As there are >2lakhs of employee and manager ID's ,I can't check for these 2 combinations within the Javascript function using the if else statements or anything else.Any ideas on how to accomplish this is highly appreciated.

2.I have a text box1 wherein multiple ID's can be entered.Also I have a drop down having the values such as Jan 10,Feb 10,Mar 10 to till date and these values are dynamically being populated from a table.
Finally, I have another textbox2 wherein I need to copy the 1st entered above textbox 1's value and the 1st entered above dropdown's value (say in the textbox1,the 1st entered ID is XYZZ and in the dropdown, if Feb 10 is being selected ;then in this textbox2 I need to get as XYZZ0210 but I should also allow the users to edit this textbox at a later stage to enter any values of their choice.)

Could anyone please help me as soon as possible for the above 2 requirements.This is really very urgent.
Thanks a lot in advance!

This message has been edited. Last edited by: info4pal,


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Master
posted Hide Post
How about just using chaining? So if a person picks a certain manager only the relevant employees are available - or vice-versa.
A variation on this would probably work with your second requirement also.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Guru
posted Hide Post
Hi,

Thanks George for the quick response and sorry for the delayed response from my end.

Actually Iam not sure whether chaining would help me in both my requirements but Iam trying a different approach for the 2nd requirement(i.e.,I have used the switch statements but unfortunately that is also not working as expected and I will try posting my tried coding soon.)

Could anyone please help me out on this one.

Thanks a lot in advance!

Regards!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Guru
posted Hide Post
Hi George,

Could you please post a sample code on how to do chaining with a single textbox which would help me!

Regards!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Master
posted Hide Post
I can't post any code, but chaining is easy enough to implement with the GUI.

If you can generate a list of managers from your data you can easily create a drop down list. Similarly, you can create a drop down list of the employees. With the chain feature you can select all - and only - the employees that report to a given manager, or vice versa if you wish to work it that way.

In my situation, we (for example) choose a certain country, and only the customers for that country are displayed. From there it's a simple matter to run reports for one, several, or all customers in that country.

You suggest that you want to use a text box to select the employees and or managers, but why would you want to do that if you can generate a list from the data? There is no way to make chaining work with a text box as far as I know.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Guru
posted Hide Post
Hi,

Thanks a lot George again for the quick response.
Yes,Iam familiar with chaining and I can give it a try....Thanks a lot again.

Regards!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Master
posted Hide Post
I do not think you can do chaining on a text box. Have you thought about using AJAX.




Scott

 
Posts: 864 | Registered: May 24, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
You can do chaining with a text box (edit box). I created an example that allows entry of numbers in an edit box and uses chaining to pass the values to a WebFOCUS procedure that validates against GGSALES.SEQ_NO. Result, valid or invalid, is displayed in the next edit box.

validate.fex
validate.htm

Down load each of these to baseapp and run validate.htm.


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 147 | Registered: October 19, 2010Reply With QuoteReport This Post
Guru
posted Hide Post
Hi,

Thanks for the quick reponses TexasStingray and dbeagan...
But I think Iam trying to check one condition and not to do chaining as the requirement as changed for the 1st question and I will try posting the same soon.

However I have got a solution for the 2nd question which I had asked for...

Aanyways thanks a lot for all your time and support on this.

Regards!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Guru
posted Hide Post
Hi Dbgean,

Iam not able to view the fex file which you had attached...

Thanks!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Guru
posted Hide Post
Hi,

This is my reqquirement...In the front end,there is a textbox wherein multiple ID's can be entered separated by a commas and the user can enter only an employee id and an employee id / a manager id and a manager id at the same time(That means the user cannot enter Emp id and manager id at the same time(say abcd is an emp id and xyz1 is a mgr)and if they enter the same,it should throw an error message.

Now I have a query which looks something like this:
select count(distinct(B)) from(select distinct B,C from table1 where A in ('ABCD','XYZ1') and (B is not null);

Now in the textbox,once the id's are entered in the textbox, it should go hit this query which is present in the fex file and if the count is greater than 1,then only it needs to throw an error.....


Could anyone please let me know how to do this...Any help is highly appreciated!

Thanks a lot for all your time in advance!

Regards!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Platinum Member
posted Hide Post
When you click the link for the fex file, do you see the message, "Apologies. There is no preview available ... Download"? If not then what do you see?

I and others suggested chaining, seems like a good fit, hopefully you can see that once you are able to run the example. I understand that you do not want to do chaining in the typical sense of displaying a list of values in the second control. But if the second control shows the valid/invalid message and you style it not to look like an edit box control, then it seems like you should be good to go.


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 147 | Registered: October 19, 2010Reply With QuoteReport This Post
Guru
posted Hide Post
Hi Dbeagan,

I was able to download the file but unfortunately this iswhat Iam trying to do in my code :

This is my reqquirement...In the front end,there is a textbox wherein multiple ID's can be entered separated by a commas and the user can enter only an employee id and an employee id / a manager id and a manager id at the same time(That means the user cannot enter Emp id and manager id at the same time(say abcd is an emp id and xyz1 is a mgr)and if they enter the same,it should throw an error message.

Now I have a query which looks something like this:
select count(distinct(B)) from(select distinct B,C from table1 where A in ('ABCD','XYZ1') and (B is not null);

Now in the textbox,once the id's are entered in the textbox, it should go hit this query which is present in the fex file and if the count is greater than 1,then only it needs to throw an error.....

Could anyone please help me on this as this is really urgent!

Regards,
Apoorva
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Master
posted Hide Post
Apoorva,

As has been suggested a couple of times already, perhaps your entire approach to this project is not optimal (I'm trying to be diplomatic here). Personally I can't understand why on earth you would want to to input IDs in a text box separated by commas. The possibilities for operator error are enormous.

Why not use a multi-select control, or in fact two controls - one for the employees and one for the managers, which would make your complicated rules for separation of employees and managers entirely unnecessary.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Master
posted Hide Post
Ok, it took me several time reading what your requirement is. you have emmployees (1123, 1456, 1789) and managers (2123, 2456, 2789) some can type as many employee id as they want in to a text box or and many managers as the want into the same test box but they cannot mix them. each one seperated by a comma. Im not going to go into the security ramifications as that your call. but at the top of the fex that display the report include the code that check to validate the id enter are either all manages or employees but not both. If they are both have the fex display a message if they are just managers or just employees then run the report. There are other ways to do this like i said using AJAX is what I would do.

Hope this helps




Scott

 
Posts: 864 | Registered: May 24, 2004Reply With QuoteReport This Post
Guru
posted Hide Post
Hi George and Patton,

Thanks for your response.
George - I also tried suggesting having 2 dropdowns - one for mgr and another for an emp but the business needs it in the form of textbox itself..
TexasStingray - Could you have some sample code in Ajax which I could use for this validation.

Thanks a lot!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Sometime challenging the business needs may makes the things involving and better...

With dropdown, you can display id + name but pass only id to your fex. So users don't have to know who has which id, they can choose a name instead. It also make your job easier and gives you bonus point to have been creative Good One

Think about it


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2282 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Guru
posted Hide Post
Hi Martin,

Thanks for the response.
Yes I do agree with you but the business wants to have the textbox and enter the ID's separated by commas in place of a dropdown.

Any ideas/help on how to do this using a textbox with the ID's entered would be highly appreciated.

Thanks!
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
Master
posted Hide Post
Putting it mildly, your "business" people are nuts.

With a list box, for example, there is nothing stopping a person from typing the employee ID, and if they type an incorrect one it won't show in the list. Validation is done right there, before they hit the submit button. If there are many employees then scrolling does become an issue, but simply tying the first few letters or numbers will bring the relevant section - or the exact match - into view. If it's a range of values you want, from employee AAAAA to AAABB, then just make two list boxes and choose the start value from the first box and the end value from the other one.

Finally, if you are dealing with thousands of employees, then just make a static list box that chains to another. In the Static one you have choices such as employees A to M, N to S, T to Z - or any breakdown that works for you.

Maybe if you could explain to me WHY your company insists on the comma-delimited list of employee IDs I could be more sympathetic, but as I see it now it is just the WRONG approach.

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Gold member
posted Hide Post
info4pal, you have been asking for this solution almost for 2 weeks. Noone will solve this for free. You have been given enough examples to solve this on your own.


Release: WebFOCUS 8104, AppStudio: 8105
OS: Windows
Output: HTML,Excel,Active Reports
 
Posts: 89 | Registered: November 19, 2013Reply With QuoteReport This Post
Guru
posted Hide Post
Hi,

Thanks a lot everyone!
I will try with Ajax or the examples being mentioned earlier...
 
Posts: 270 | Registered: October 30, 2014Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Javascript Validation Help needed.Very Very urgent!!

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.