Code: Select all
var newssn = $('#FRM_ssn').val();
var lastname = $('#FRM_lastname').val();
var firstname = $('#FRM_firstname').val();
var sql = '';
if (newssn !== "") {
nuSetProperty('nuSSNField', newssn, true);
nuRunPHPHidden("encryptSSN",0);
//alert("Enc SSN="+window.newencssn);
sql = sql + " AND TaxCustomers.cust_prissn = '" + newencssn +"'";
} else {
if (lastname !== "") {
sql = sql + " AND TaxCustomers.cust_lastname LIKE '" + lastname +"%'";
}
if (firstname !== "") {
sql= sql + " AND TaxCustomers.cust_firstname LIKE '" + firstname +"%'";
}
}
sql = sql.substr(5);
nuSetProperty('FRM_search', sql, true);
nuSetProperty('FRM_srchsqlform', 'Y', true);
nuSetProperty('SEARCH_FIELD', '');
alert('Form SQL='+sql);
if (sql !== "" ) {
nuForm('60887a31411ae22', '', '', '', '0');
}
Code: Select all
$f = __DIR__ . "/proc_mxssn.php";
// nuDebug("Directory= ".$f);
include_once($f);
$e = mixSSN("#nuSSNField#");
$js =
"
window.newencssn = '$e';
";
nuDebug("In EncryptSSN =".$js);
nuJavascriptCallback($js);
Here's the problem: In the Javascript above that is on my button on my form, if I unremark the //alert("Enc SSN="+window.newencssn); I do not get anything for the variable. HOWEVER, the next line that sets the SQL variable works based on the alert: alert('Form SQL='+sql); that is executed right before the search form is called. If I remark out the //alert("Enc SSN="+window.newencssn); The SQL variable DOES not get set properly. The newencssn variable has nothing in it. WHY?
Am I not transferring the results properly from the call to: nuRunPHPHidden("encryptSSN",0); ?
Why is the newencssn variable accessible if I dont have the alert remarked, btu it is not or its empty if I have the alert remarked out?