我如何创建oracle apex服务器端实时验证而无需提交页面 [英] How can I create oracle apex server side live validation without need to submit page

查看:350
本文介绍了我如何创建oracle apex服务器端实时验证而无需提交页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为客户创建了表单,我需要像

I created form for customers, I need to do validate customer name like

1 - type the new name into item P1_CUST_NAME.
2 - after leaving this item go to database and check if this name already exist or not. 
3 - display alert or message for the client.
4 - prevent the client from navigating a way from this item until he enter valid data.

推荐答案

是的,您可以使用Dynamic Action和JavaScript函数apex.server.process创建服务器端验证.

Yes, you can create server side validation by using Dynamic Action and JavaScript function apex.server.process.

一个基本的例子来演示-

A basic example to demonstrate-

  • 创建页面项目,例如您页面中的P4_NAME
  • 创建页面处理并将执行点选择为"AJAX 打回来".
  • Create a page item e.g. P4_NAME in your page
  • Create a page process and select the execution point as "AJAX CALLBACK".

在下面的代码中,我正在检查P4_ITEM值,您可以编写自己的逻辑进行验证.

In below code I am checking the P4_ITEM value, you can write your own logic to validate.

BEGIN
   IF :P4_NAME = 'HIMANSHU'
   THEN
      HTP.prn ('SUCCESS');
   ELSE
      HTP.prn ('ERROR');
   END IF;
END;

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆