displaying <td> within cfinput when table row clicked on

J

John

I am attempting to make a table data row editable once clicked on but
I am not sure how to show the <td> with two different states. I've got
it to the point where the <td> is hidden then appears within a cfinput
when clicked on, but not sure where to go from here.

Thanks for looking!

<script language="javascript">
function showField(thisID){
//alert("which: "+which+" more stuff here");
identity = document.getElementById(thisID);
identity.style.display="none";
}
</script>


<tr onclick="showField(#id#);"
onMouseOver="this.style.backgroundColor='##99CCFF'"
onMouseOut="this.style.backgroundColor=''" BGCOLOR="###IIF(CurrentRow
MOD 2, DE ('E5E5E5'), DE ('FFFFFF'))#">


<td id="RestrictDate"><div id="#id#" style="display:inherit"><cfinput
name="RestrictDate" type="text" validate="date" message="you must
enter the date in mm/dd/yyyy format"
value="#DateFormat(RestrictionDate, "mm/dd/yyyy")#"></div></td>
 
A

ASM

John a écrit :
I am attempting to make a table data row editable once clicked on but
I am not sure how to show the <td> with two different states. I've got
it to the point where the <td> is hidden then appears within a cfinput
when clicked on, but not sure where to go from here.

what could be a 'cfinput' ?
<script language="javascript">
function showField(thisID){
//alert("which: "+which+" more stuff here");
identity = document.getElementById(thisID);
identity.style.display="none";
}
</script>


<tr onclick="showField(#id#);"

curious ... to show the td's content you hide it ?
onMouseOver="this.style.backgroundColor='##99CCFF'"
onMouseOut="this.style.backgroundColor=''" BGCOLOR="###IIF(CurrentRow
MOD 2, DE ('E5E5E5'), DE ('FFFFFF'))#">

what does mean :

BGCOLOR="###IIF(CurrentRow MOD 2, DE ('E5E5E5'), DE ('FFFFFF'))#"

????
<td id="RestrictDate"><div id="#id#" style="display:inherit"><cfinput
name="RestrictDate" type="text" validate="date" message="you must
enter the date in mm/dd/yyyy format"
value="#DateFormat(RestrictionDate, "mm/dd/yyyy")#"></div></td>

<script type="text/javascript">

function showHide(what) {
$(what).style.display = $(what).style.display=='none'?
'block' : 'none';
}
function $(smth) {
return typeof(smth)=='string')?
document.getElementById(smth) : smth;
}
</script>

<form blah >
<table>
<tr>
<td><button onclick="showHide('dat');">show / hide</button></td>
<td>
<p id="dat" style="display:none">
enter the date in mm/dd/yyyy format :
<input type=text name="date">
</p>
</td>
</tr>
<tr onclick="showHide('datDay');">show / hide</button></td>
<td>
<p id="datDay" style="display:none">
enter the date in mm/dd/yyyy format :
<input type=text name="date">
</p>
&nbsp;
</td>
</tr>
 
T

Tom Cole

John a écrit :


what could be a 'cfinput' ?

My guess would be cold fusion...
curious ... to show the td's content you hide it ?


what does mean :

BGCOLOR="###IIF(CurrentRow MOD 2, DE ('E5E5E5'), DE ('FFFFFF'))#"

Again I imagine cold fusion markup for odd/even row differentiation.
????


<script type="text/javascript">

function showHide(what) {
$(what).style.display = $(what).style.display=='none'?
'block' : 'none';}

function $(smth) {
return typeof(smth)=='string')?
document.getElementById(smth) : smth;}

??? Wouldn't this do?

function $(smth) {
return document.getElementById(smth) || smth;
}
 
A

ASM

Tom Cole a écrit :
John a écrit :


what could be a 'cfinput' ?

My guess would be cold fusion... [...]
what does mean :

BGCOLOR="###IIF(CurrentRow MOD 2, DE ('E5E5E5'), DE ('FFFFFF'))#"

Again I imagine cold fusion markup for odd/even row differentiation.

Probably but ... why not to show normal html code ?
(this seen in a browser)
??? Wouldn't this do?

function $(smth) {
return document.getElementById(smth) || smth;
}

Not enough twisted :)

Gasp !

 
J

John

Sorry for not mentioning, yes I am using coldfusion for my form
submission.

Tom is correct, the iif line is cold fusion markup for odd/even row
differentiation.

Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top