You probably want to use the onChange event for the select list itself, something like this (untested code) :

<SCRIPT LANGUAGE="_javascript_">
function doSwitchDIV(oSelList) {
  var val = oSelList.options[oSelList.selectedIndex].value;
  if (val == 'forsale') switchDiv('ez');
  if (val == 'forrent') switchDiv('full');
  if (val == 'forlease') switchDiv('superduper');
}
</SCRIPT>

<cfform name="the_form">
<tr height="12" valign="top">
<td align="left"><cfselect name="PropertyDataHouseType" class="#SMSformStyle1#">
<option value="forsale">For Sale</option>
<option value="forrent">For Rent</option>
<option value="forlease">For Lease</option>   
</cfselect></td>
<td align="left">&nbsp;</td>
<td align="left">&nbsp;</td>
</tr>
</cfform>

Chris

-----Original Message-----
From: Stuart Kidd [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 11:10 AM
To: CF-Talk
Subject: select boxes and _javascript_

Hi guys,

I'm trying to work out how to trigger my _javascript_ within a select box:

<cfform name="the_form">
<tr height="12" valign="top">
<td align="left"><cfselect name="PropertyDataHouseType" class="#SMSformStyle1#">
<option value="forsale" Sale</option>
<option value="forrent" Rent</option>
<option value="forlease" Lease</option>   
</cfselect></td>
<td align="left">&nbsp;</td>
<td align="left">&nbsp;</td>
</tr>
</cfform>

I've tried all types like onMouseOut, OnChange, onClick, does anyone know what i should be using?  It's setting off a script to show the appropriate DIV.

Thanks,

Stuart
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to