Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    271
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Can this be Done

    On a page is there a way to have a link so when you click on it the page when the link is at shows something that is not there until you click on the link

    This what I see in the background on the page I saw it on

    <td align="right"><input value="Modify Search" onclick="switchShowSearch(); return false" class="formbutton" onmouseover="formbuttonClassNew(this,'formbuttonover')" onmouseout="formbuttonClassNew(this,'formbutton')" type="button"></td>

    Thxs Steve

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,373
    Thanks
    11
    Thanked 592 Times in 572 Posts
    "shows something that is not there"

    huh?

    can you tell us a little more about what you want to do?
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Very basic idea of showing hidden content:

    Code:
    <div id="foo">Some Text Hidden</div>
    <input type="button" onclick="document.getElementById('foo').style.display='block'" value="show"/>
    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    271
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Yes that is right and after searching for hours I found it unless you have something better

    THXS Steve


    LANGUAGE="JavaScript" TYPE="text/javascript">


    function switchShowSearch()
    {
    id = 'showModifySearch';

    if (document.getElementById) {
    current = document.getElementById(id).style.visibility;

    if (current == 'visible') {
    document.getElementById(id).style.visibility = 'hidden';
    document.getElementById(id).style.display = 'none';
    }
    else {
    document.getElementById(id).style.visibility = 'visible';
    document.getElementById(id).style.display = 'block';
    }
    }
    else {
    if (document.layers) { // NS4
    eval('document.' + id + '.visibility = "hidden"');
    }
    else { // IE4
    eval('document.all.' + id + '.style.visibility = "hidden"');
    }
    }
    }

    </SCRIPT>

  • #5
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    That code is so out of Date. document.layers is for a browser that is 10 years old.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    271
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Can you tell me where i can find something newer as that is all I could find

    THXS Steve

  • #7
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,373
    Thanks
    11
    Thanked 592 Times in 572 Posts
    Code:
    function showme(s) {
        var elmt = s.split ? document.getElementById(s) : s;
        var els = elmt.style;
        if ( els.display != "none") {
            elmt._sty_disp_bk = els.display || "";
            elmt.display = "none";
        } else {
            elmt.display= elmt._sty_disp_bk || "";
            return 1;
        }
    }
    use like showme('showModifySearch'), or directly pass the element.
    returns 1 if now visible.
    Last edited by rnd me; 09-10-2008 at 02:38 AM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Posts
    271
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rnd me View Post
    Code:
    function showme(s) {
        var elmt = s.split ? document.getElementById(s) : s;
        var els = elmt.style;
        if ( els.display != "none") {
            elmt._sty_disp_bk = els.display || "";
            elmt.display = "none";
        } else {
            elmt.display= elmt._sty_disp_bk || "";
            return 1;
        }
    }
    use like showme('showModifySearch'), or directly pass the element.
    returns 1 if now visible.

    Could you Please redo this as I do not understand how to change it

    THXS


    <form>
    <td align="right" valign="bottom"> <input type="button" value="Search" class="formbutton" onClick="switchShowSearch(); return false" onMouseOver="formbuttonClassNew(this,'formbuttonover')" onMouseOut="formbuttonClassNew(this,'formbutton')"></td>
    </form>

  • #9
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,373
    Thanks
    11
    Thanked 592 Times in 572 Posts
    you did say please.


    Code:
    <form>
    <td align="right" valign="bottom"> 
    <input type="button" value="Search" class="formbutton" 
       onClick="showme('showModifySearch'); return false" 
       onMouseOver="formbuttonClassNew(this,'formbuttonover')" 
       onMouseOut="formbuttonClassNew(this,'formbutton')">
    </td>
    </form>
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Posts
    271
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I put the new one where the old one was and does not work

    Anything I have to change


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •