Hi Folks
It would appear i am a complete JS dipstick %$%$##&
i have a dynamically produced table that list business names and their telephone numbers (code below):
[code]
<cfset rowcounter = 0>
<cfloop query=”freelist” startrow=”#URL.offset#” endrow=”#limit#”>
<cfif isDefined(“rowcounter”)>
<cfset rowcounter = rowcounter+1>
</cfif>
<cfoutput>
<form name=”form#rowcounter#” method=”post” action=””>
<tr bgcolor=”###iif(currentrow MOD 2,DE(‘ebebeb’),DE(‘ffffff’))#” class=”smalltext11light”>
<td width=”76%”> #freelist.busname# </td>
<td width=”4%”>
<input type=”checkbox” name=”chk#rowcounter#” onclick=”showhidefield()”> </td>
<td width=”20%”><div id=’hide’ style=’display:none’> #freelist.busphone#</div></td>
</tr>
</form>
</cfoutput>
</cfloop>
as you can see i have included a checkbox in each individual for that will display the telephone number for that business when clicked and as you can see when the page loads the telephone is blank.
I have a js function (below)
[code]
<script language=”JavaScript”>
function showhidefield(){
if (document.form.chk.checked)
{document.getElementById(“hide”).style.display = “block”;}
else
{document.getElementById(“hide”).style.display= “none”;}
}
</script>
What (i think) i need to do is populate that function with the correct variables to show the correct phone number when the appropriate checkbox is clicked.
Can someone please help me
cheers and thanks in advance
Grabit