displaying <td> within cfinput when table row clicked on

Discussion in 'Javascript' started by John, Mar 15, 2007.

  1. John

    John Guest

    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>
    John, Mar 15, 2007
    #1
    1. Advertising

  2. John

    ASM Guest

    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
    ASM, Mar 15, 2007
    #2
    1. Advertising

  3. John

    Tom Cole Guest

    On Mar 15, 1:29 pm, ASM <>
    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
    Tom Cole, Mar 15, 2007
    #3
  4. John

    ASM Guest

    Tom Cole a écrit :
    > On Mar 15, 1:29 pm, ASM <>
    > 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
    ASM, Mar 15, 2007
    #4
  5. John

    John Guest

    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!
    John, Mar 16, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. phl
    Replies:
    1
    Views:
    4,346
    Martin Jay
    Jun 8, 2006
  2. D
    Replies:
    0
    Views:
    206
  3. Replies:
    5
    Views:
    161
  4. trint
    Replies:
    2
    Views:
    235
    Randy Webb
    Nov 16, 2006
  5. iwasjoeking
    Replies:
    2
    Views:
    136
    iwasjoeking
    Jun 7, 2007
Loading...

Share This Page