Copy link to clipboard
Copied
Can not get onClick syntax to work correctly. Help is much appreciated.
<cfform action="nexpage.cfm" target="_self" method="post" enctype="application/x-www-form-urlencoded" name="frm1" format="flash" width="900" height="700" skin="haloblue">
<cfformgroup type="horizontal">
<cfformitem type="text" width="300" enabled="yes">How did you learn of our online process?</cfformitem>
<cfinput type="radio" name="lead" label="Newspaper" value="1" onClick="document.frm1.newspaper.disabled=false" />
<cfselect disabled="true" visible="yes" name="newspaper" id="newspaper" multiple="no" width="250" >
<option value="">Select one</option>
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</cfselect>
</cfformgroup>
<cfformgroup type="horizontal">
<cfformitem type="spacer" width="300" enabled="yes" />
<cfinput type="radio" name="lead" label="Job Center" value="2" onClick="document.frm1.JCenter.disabled=false" />
<cfselect disabled="true" visible="yes" name="JCenter" id="JCenter" multiple="no" width="250" >
<option value="">Select one</option>
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option3</option>
</cfselect>
</cfformgroup>
</cfform>
onClick="document.frm1.newspaper.disabled=false"
It looks like you are using javascript. Flash forms use actionscript. It is a totally different beast.
UPDATE:
Never mind. My previous suggestion will not work because the radio fields have the same name. I am sure there are better ways.
But you could call a function onClick. One that changes the state of the select lists..
<cfformitem type="script">
function setListState() {
newspaper.enabled = (lead.selectedData == 1);
Copy link to clipboard
Copied
onClick="document.frm1.newspaper.disabled=false"
It looks like you are using javascript. Flash forms use actionscript. It is a totally different beast.
UPDATE:
Never mind. My previous suggestion will not work because the radio fields have the same name. I am sure there are better ways.
But you could call a function onClick. One that changes the state of the select lists..
<cfformitem type="script">
function setListState() {
newspaper.enabled = (lead.selectedData == 1);
JCenter.enabled = (lead.selectedData == 2);
}
</cfformitem>
<cfinput type="radio" name="lead" label="Newspaper" value="1" onClick="setListState()">
...
<cfinput type="radio" name="lead" label="Job Center" value="2" onClick="setListState()">
Message was edited by: -==cfSearching==-
Copy link to clipboard
Copied
I always use the same name for a group of radio buttons.
The selects are all different names as those are distinct. Radio buttons are part of same 'grouping'
Copy link to clipboard
Copied
Of course, and that makes sense. I simply meant the first technique I described would not work here, because it is designed to work with a different type of object (radiobutton versus radiobuttongroup). Anyway, take a look at the suggested alternative in my edited post.
Message was edited by: -==cfSearching==-
Copy link to clipboard
Copied
Is the onClick doing anything at all?
Copy link to clipboard
Copied
Yes, it works if you use actionscript instead of javascript.