Check duplicate on the fly

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
Danny

Check duplicate on the fly

Post by Danny »

Hi, it would be nice if we enable "Check duplicate", the check is "On the fly" javascript, so that you don't have to fill the complete form, before you see any duplicate message.

  1. We put an onchange event into Custom Attributes.
  2. Client Script, Client script, Addpage:

function checkduplicate() {
var lst =document.getElementById("x_Text2").Value;
.............................?
{
alert("Duplicate value found !");
}
else
{
alert("No Duplicates !");
}
}

How we can check the ("x_Text2") field in the database by Javascript?

Regards, Danny


Webmaster
User
Posts: 9425

Post by Webmaster »

Currently this is not supported. You need to write the javascript to issue a server request (AJAX) to the server (so a corresponding server page) to verify if the record is duplicated.


Danny

Post by Danny »

Hi,

We add the ajax code to the script:

function checkduplicate() {
var lst =document.getElementById("x_Text2").Value;

var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("x_Text2").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","?????????????????????.aspx",true);
xmlhttp.send();

{
alert("Duplicate value found !");
}
else
{
alert("No Duplicates !");
}
}

What do we need more to check the field x_text2 against the database ?

Regards, Danny


Webmaster
User
Posts: 9425

Post by Webmaster »

As explained, you need to write your own server side page (*.aspx) to perform the validation.


Danny
User
Posts: 138

Post by Danny »

Hi,

You said: Currently this is not supported.

Is it easier with version 2018 now ?

Regards,


Webmaster
User
Posts: 9425

Post by Webmaster »

No, not yet supported.

For feature request, please post to the Feature Requests board for our future consideration. Thank you.


Post Reply