- Sun Apr 23, 2017 1:49 pm
#790451
How do I test if a suggest control has successfully found something?
Name of control is "searchByName" with a sql "SELECT PARTY.PARTY_ID, CONCAT(PARTY.FIRST_NAME, " ", PARTY.LAST_NAME) AS PARTY_NAME FROM PARTY"
Database record is something like this
party_id, party_first_name, party_last_name
1,John,Lewis
2,Peter,Pan
Then on the Dynaform I would like to check if something is found. For example if "Peter" is input and selected
$("#searchByName").getValue() gives me "2" and $("#searchByName").getText() gives "Peter Pan"
However when I try below it always alert "found" even if I input "Mary" into the control
if ($("#searchByName").getValue() == $("#searchByName").getText() ) {
alert("not found");
} else {
alert("found");
}
Name of control is "searchByName" with a sql "SELECT PARTY.PARTY_ID, CONCAT(PARTY.FIRST_NAME, " ", PARTY.LAST_NAME) AS PARTY_NAME FROM PARTY"
Database record is something like this
party_id, party_first_name, party_last_name
1,John,Lewis
2,Peter,Pan
Then on the Dynaform I would like to check if something is found. For example if "Peter" is input and selected
$("#searchByName").getValue() gives me "2" and $("#searchByName").getText() gives "Peter Pan"
However when I try below it always alert "found" even if I input "Mary" into the control
if ($("#searchByName").getValue() == $("#searchByName").getText() ) {
alert("not found");
} else {
alert("found");
}