hi i have some which is not working fine with me:, what i am trying to achieve is to show/toggle the elements when i click one or the other thing from the select menu
here is my code below:
[code=html]<SELECT NAME=”ptype” onchange=”toggleSubmit(this);”>
<option value=”Contract”>Contract</option>
<option value=”Direct_hire”>Direct Hire</option>
</select>
now the javascript i am using:
HTML Code:
[code=html]<script language=javascript type=’text/javascript’>
function toggleSubmit(sel)
{
var area = document.getElementById(‘contract’);
if ( sel.options[sel.selectedIndex].value == “Contract” )
{
Contract.style.display = “block”;
}
else
{
Direct_hire.style.display = “block”;
}
} </script>
now te which which gets egffected..
[code=html]<tr id=”Contract” style=”display: none;”>
<td>
<CFIF Form.ptype EQ “Contract”>
<TR>
<TD BGCOLOR=”##99cc99″ COLSPAN=3><FONT FACE=”Arial, Helvetica, sans-serif” SIZE=”1″><B>NUMBER OF CONTRACTORS</B></FONT></TD>
</TR>
<TR>
<TD WIDTH=30> </TD>
<TD COLSPAN=2><cfINPUT TYPE=text NAME=”c_numcontractors” VALUE=”hidden” required=”yes” message=”Please fill No of Contractors for it.”></TD>
</TR>
</CFIF>
</td></tr>
<tr id=”Direct_hire” style=”display: none;”>
<td>
<CFIF ptype EQ “Direct hire”>
<TR id=”Direct hire” style=”display:none;”>
<TD BGCOLOR=”##99cc99″ COLSPAN=3><FONT FACE=”Arial, Helvetica, sans-serif” SIZE=”1″><B>TARGET COMPENSATION</B></FONT></TD>
</TR>
<TR>
<TD WIDTH=30> </TD>
<TD COLSPAN=2><cfINPUT TYPE=text NAME=”h_compensation” VALUE=”#Form.h_compensation#” size=25 required=”yes” message=”Target Compensation field required”></TD>
</TR>
</CFIF></td></tr>
if div can be placed with the above tr to work properly, it can be done, can u let me know how to achieve that plz
i am new in javascripting