Focal Point
[CLOSED]Webfocus with Ajax help needed!

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

November 28, 2014, 03:57 AM
info4pal
[CLOSED]Webfocus with Ajax help needed!
Hi,
I have a textbox wherein multiple Id's of 4 digits(alphanumeric) can be entered separated by commas and I can enter rep id and rep id(say ABCD,BCD1) or mgr id and mgr id(say CDE1,PQRS) at any point in time and it shouldn't throw an error for this.
If I enter an emp id and a mgr id at the same time in the textbox(say ABCD is a emp id,CDE1 is a mgr id),then it should throw an error(display an alert box) saying that it is an invalid entry.Both the emp id and the mgr id are being fetched from the same
Iam using this query below and if the count is greater than 1, then I need to show an alert message through the [front end(HTML Page) when the user enters the emp id and the mgr id in the textbox at the same time ] saying that it is an invalid entry through an alert box or something.

ENGINE oracle SET DEFAULT_CONNECTION instance1
SQL SQLORA PREPARE SQLOUT FOR
select COUNT(*) from (select distinct title,type from table1
where id in ('ABCD','BCD1','CDE1')and title is not null );
END

Could anyone please help me to do this in Javscriptor/ajax.
Any help is highly appreciated.Thanks a lot in advance!

Regards!

This message has been edited. Last edited by: info4pal,
November 28, 2014, 05:18 AM
Wep5622
You can simply chain your textbox control to a hidden field that runs a procedure.

Then in Javascript you call a function in onInitialUpdate() or in an onchange event handler on the hidden field. That function then checks whether your hidden field contains a value - if so, show an error, if not, stay silent.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
November 28, 2014, 05:28 AM
info4pal
Hi,

Thanks for the reply.
Any sample code using CAR file would be really helpful.

Thanks a lot in advance!
November 28, 2014, 05:30 AM
info4pal
Hi,

I will be actually entering the ID's in the textbox and the textbox will contain the values entered at any point in time.

Hope Iam clear now.

Thanks!
November 28, 2014, 10:24 AM
Wep5622
I just found that your question has already been answered in a related thread. Why did you start a new one?


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
November 28, 2014, 11:09 PM
info4pal
Hi,

Wep5622 - By mistake the question has got duplicated.

Thanks!