Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > displaying <td> within cfinput when table row clicked on

Reply
Thread Tools

displaying <td> within cfinput when table row clicked on

 
 
John
Guest
Posts: n/a
 
      03-15-2007
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>

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      03-15-2007
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>


--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
 
Reply With Quote
 
 
 
 
Tom Cole
Guest
Posts: n/a
 
      03-15-2007
On Mar 15, 1:29 pm, ASM <(E-Mail Removed)>
wrote:
> 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' ?


My guess would be cold fusion...

>
> > <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'))#"


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

>
> ????
>
> > <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;}


??? Wouldn't this do?

function $(smth) {
return 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>
>
> --
> Stephane Moriaux et son (moins) vieux Mac déjà dépassé
> Stephane Moriaux and his (less) old Mac already out of date



 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      03-15-2007
Tom Cole a écrit :
> On Mar 15, 1:29 pm, ASM <(E-Mail Removed)>
> wrote:
>> John a écrit :
>>
>>> 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' ?

>
> 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)

>> <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;
> }


Not enough twisted

>> </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>


Gasp !

<tr onclick="showHide('datDay');">


>> <td>
>> <p id="datDay" style="display:none">
>> enter the date in mm/dd/yyyy format :
>> <input type=text name="date">
>> </p>
>> &nbsp;
>> </td>
>> </tr>


--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
 
Reply With Quote
 
John
Guest
Posts: n/a
 
      03-16-2007
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!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apply CSS style for table row if radio button is clicked iwasjoeking Javascript 2 06-07-2007 07:30 PM
Need to check file field for content in <cfinput type="file" name="custCartThumb"> trint Javascript 2 11-16-2006 12:07 AM
row bottom border in inner table not matching up with row border in outer table phl HTML 1 06-08-2006 03:43 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
capture row of table clicked - javascript chandramohan.mani@gmail.com Javascript 5 01-21-2005 09:01 AM



Advertisments