...

View Full Version : Can this be Done



stevan
09-08-2008, 11:55 PM
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

rnd me
09-09-2008, 06:18 AM
"shows something that is not there"

huh?

can you tell us a little more about what you want to do?

A1ien51
09-09-2008, 06:26 AM
Very basic idea of showing hidden content:



<div id="foo">Some Text Hidden</div>
<input type="button" onclick="document.getElementById('foo').style.display='block'" value="show"/>


Eric

stevan
09-09-2008, 01:19 PM
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>

A1ien51
09-09-2008, 03:32 PM
That code is so out of Date. document.layers is for a browser that is 10 years old.

Eric

stevan
09-09-2008, 10:43 PM
Can you tell me where i can find something newer as that is all I could find

THXS Steve

rnd me
09-10-2008, 03:35 AM
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.

stevan
09-10-2008, 03:42 AM
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>

rnd me
09-10-2008, 04:00 AM
you did say please.





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

stevan
09-10-2008, 04:39 AM
I put the new one where the old one was and does not work

Anything I have to change



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum