Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

Query result is empty trigger my function

Hi,

I want to do this:  

If my query result recordcount eq 0 then execute my JQuery function.


this is my JQuery function that I want to trigger if my query result eq 0

function doTheSubmit() {

	  window.opener.$("#SelectDepartmentImpacted option").prop("selected",true)	
	  window.opener.$("#SelectSystem option").prop("selected",true)
	  window.opener.$("#DispSelectedGroupBox option").prop("selected",true)

	  window.opener.document.LogEntryFrm.SubLogEntry.click(); 

      window.close(); 
      return false;
    }

Open in new window





This is my query.

<cfquery name = "QSearchResult"  datasource='#strDSN#' username='#strUID#' password='#strPWD#' result="r">

select * from test

</cfquery>


<CFIF isDefined("QSearchResult") and #QSearchResult.RecordCount# eq 0>

// here how can say to call my jquery function doTheSubmit() ?

</CFIF>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Coast Line
Coast Line
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulu50

ASKER

Thank you