Hoping someone can help with a field event. I have the code working, but I want to check if we get a result and if not I want the event to stop and tell the user and then they can edit again. I have
Client before:
params["value"] = this.getValue();
Server:
$sql = "Select oid from location_master where
location_id = '".$params["value"]."'";
$rs = CustomQuery($sql);
$data=db_fetch_array($rs);
$result["locoid"]=$data["oid"];
$result["SQL"] = $sql;
$result["upper"] = strtoupper( $params["value"] );
Client After:
var ctrlLoc = Runner.getControl(pageid,'Location_oid');
this.setValue( result["upper"] );
If the sql returns nothing I want to prompt the user - they did not enter a valid location and stay in the field for them to enter again.
Client before:
params["value"] = this.getValue();
Server:
$sql = "Select oid from location_master where
location_id = '".$params["value"]."'";
$rs = CustomQuery($sql);
$data=db_fetch_array($rs);
$result["locoid"]=$data["oid"];
$result["SQL"] = $sql;
$result["upper"] = strtoupper( $params["value"] );
Client After:
var ctrlLoc = Runner.getControl(pageid,'Location_oid');
this.setValue( result["upper"] );
If the sql returns nothing I want to prompt the user - they did not enter a valid location and stay in the field for them to enter again.