This topic is locked

How to add character limit for ajax popup suggest

12/19/2014 10:13:58 AM
ASPRunnerPro General questions
E
entalpi author

Hi,
I have an ajax popup in an add page which is checking for about 50.000 product IDs. As you would guess, it has high performance issues because the number of the records is high. However, I want to increase the performance by adding a character limit to the suggest function of the ajax popup. So, when the user enters a character which is less than 5 characters, I do not want the ajax popup to search database and try to suggest the product numbers. After adding the 5th character, it should start searching. I think I need to put an if condition to "before process" but I am not sure how to do it and need some help. Thanks for your interest

acaruson 12/30/2014



Hi,
I have an ajax popup in an add page which is checking for about 50.000 product IDs. As you would guess, it has high performance issues because the number of the records is high. However, I want to increase the performance by adding a character limit to the suggest function of the ajax popup. So, when the user enters a character which is less than 5 characters, I do not want the ajax popup to search database and try to suggest the product numbers. After adding the 5th character, it should start searching. I think I need to put an if condition to "before process" but I am not sure how to do it and need some help. Thanks for your interest


This is an interesting question. I'd love to know too. "Does ASPRunner use a constant function for search fields using AJAX." In other words,mthe same one each time?
Does it begin with an "if" statement that tests the length of the input?
Something like (example):
if (str.length == 0) {

document.getElementById("txtHint").innerHTML = "";

return;

} else {

Blah blah blah....
If so, couldn't one just adjust the string length check from 0 to a higher number?
I'm curious to know too.