Populating the hidden fields is probably the way to go for you, or work with a hidden IFrame and do your checking there.
 
The other way you could do it with WDDX is to create the WDDX package with JS and then pass it to CF, that's where you use <cfwwdx> to decode the package and have instant CF variables available to you.
 
There are some JS samples with the download from www.openwddx.org, and CF samples can be found when looking at the doco's of CF.
 

Taco Fleur
07 3535 5072

Blog: http://www.tacofleur.com/index/blog/
Methodology: http://www.tacofleur.com/index/methodology/
Tell me and I will forget
Show me and I will remember
Teach me and I will learn

-----Original Message-----
From: George Lu [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 March 2004 10:34 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Passing _javascript_ variables to CF

Thanks Taco. I'm interested the second method. Do you have a quick example how to use <cfwddx>?
 
George

>>> [EMAIL PROTECTED] 1/03/04 9:02:26 >>>
You'd have to add some hidden form fields to your form, have JS to populate these fields and submit the form, then use the form fields to perform the duplicate search.
Or use WDDX (www.openwddx.org) <cfwddx> it allows you to pass variables from JS to CF and vice versa (plus more)...
 

Taco Fleur
07 3535 5072

Blog: http://www.tacofleur.com/index/blog/
Methodology: http://www.tacofleur.com/index/methodology/
Tell me and I will forget
Show me and I will remember
Teach me and I will learn

-----Original Message-----
From: George Lu [mailto:[EMAIL PROTECTED]
Sent: Monday, 1 March 2004 9:58 AM
To: CFAussie Mailing List
Subject: [cfaussie] Passing _javascript_ variables to CF

Hi,
 
I'd like to search duplicates in the database before submit the form. The question is how can I pass _javascript_ variables to a SQL query. CF complaints (variable y is not defined) if I use it directly:
 
  y = document.AddNewItem;
  // search existing items in whole database
  <CFQUERY NAME="qSearchDuplicates" DATASOURCE="#request.app.dsn#" BLOCKFACTOR="100">
   SELECT HardwareAddr,IPAddr,SERIALNUMBER,ASSETNUMBER
   FROM  tblPrinter_inventory
   WHERE
     <CFIF y.ASSETNUMBER.value IS NOT "">
      AND (tblPrinter_inventory.ASSETNUMBER = 'y.ASSETNUMBER.value')
     </CFIF>
     <CFIF y.HardwareAddr.value IS NOT "">
      AND (tblPrinter_inventory.HardwareAddr = 'y.HardwareAddr.value')
     </CFIF>
     <CFIF y.IPAddr.value IS NOT "">
      AND (tblPrinter_inventory.IPAddr = 'y.IPAddr.value')
     </CFIF>
     <CFIF y.SERIALNUMBER.value IS NOT "">
      AND (tblPrinter_inventory.SERIALNUMBER = 'y.SERIALNUMBER.value')
     </CFIF>
  </CFQUERY>
   
  if (qSearchDuplicates.recordcount == 0) {
   y.submit();
   }
  else {
   alert("Printer with the same either Hardware or IP Address, Serial or Asset number already exists in the Inventory database.\n\nPlease check the details and try again.");
   return false
  }
 
Thanks,
George
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

AMES (Adult Multicultural Education Services)
www.ames.net.au


Disclaimer
**********************************************************************
This email and any attachments may be confidential.
If received in error, please contact us and delete all copies.
Before opening or using attachments you should check them for viruses
or defects.
Regardless of any loss, damage or consequence, whether caused by the
negligence of the sender or not, resulting directly or indirectly from
the use of any attached files our liability is limited to resupplying
any affected attachments.
Any representations or opinions expressed are those of the individual
sender, and not necessarily those of Adult Multicultural Education
Services (AMES).

**********************************************************************
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

AMES (Adult Multicultural Education Services)
www.ames.net.au


Disclaimer
**********************************************************************
This email and any attachments may be confidential.
If received in error, please contact us and delete all copies.
Before opening or using attachments you should check them for viruses
or defects.
Regardless of any loss, damage or consequence, whether caused by the
negligence of the sender or not, resulting directly or indirectly from
the use of any attached files our liability is limited to resupplying
any affected attachments.
Any representations or opinions expressed are those of the individual
sender, and not necessarily those of Adult Multicultural Education
Services (AMES).

**********************************************************************
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to