Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fieldset=hidden onclick show 2

Status
Not open for further replies.

Tracey

Programmer
Oct 16, 2000
690
NZ
hi there [wavey]

i have a fieldset whose class=hidden
Code:
<style type=&quot;text/css&quot;><!--
.hidden { display:none;}
.shown {display:inline;}
--></style>
<fieldset class=hidden>
<LEGEND><b>Search for Incident</b></LEGEND>
<Form name=incsearch action=&quot;/cgi-bin/etime.exe/incsearch&quot; method=post name=frm3>
<input type=&quot;HIDDEN&quot; name=&quot;ID&quot; value =&quot;29&quot;>
<table>
<tr><td>Key words</td><td><INPUT TYPE=&quot;text&quot; NAME=&quot;advsearch&quot; onkeyup=&quot;searchinc(advsearch.value, 1, 29)&quot;></td></tr>
<tr><td></td><td><select multiple name=&quot;comboResults&quot; class=&quot;hugeselect&quot;></select>
</table></form></fieldset>
i would like to set display=inline when a user clicks a button on a form above it.

<input type=submit name=whatever value=&quot;Advanced&quot; onclick=&quot;what_on_earth_do_I_say_here?;&quot;>[fish2]







Tracey
Remember... True happiness is not getting what you want...

Its wanting what you have got!
 
Hey Tracey,

I'm pretty sure the syntax for that is:
<input type=submit name=whatever value=&quot;Advanced&quot; onclick=&quot;this.className='shown'&quot;>

I hope that does it.




Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
Tracey and Travis,

you need to reference the fieldset - i would give it an id:

<fieldset class=&quot;hidden&quot; id=&quot;fs1&quot;>

<input type=&quot;submit&quot; name=&quot;whatever&quot; value=&quot;Advanced&quot; onclick=&quot;document.getElementById('fs1').className='shown';&quot; />

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Of course...

you have to use the ID of the fieldset that you want to apply the class to. I don't know why I put 'this'...

Thanks Jeff.
 
ok guys. I now have
Code:
<input type=submit value=Advanced onclick=&quot;document.getElementById('fieldsearch').className='shown';return false();&quot;>

<fieldset class=hidden id=&quot;fieldsearch&quot;>

I dont know if this works because my form submits when i click the advanced button.
why does my form keep submitting?

Tracey
Remember... True happiness is not getting what you want...

Its wanting what you have got!
 
Try dropping the () from the false, like so:

<input type=submit value=Advanced onclick=&quot;document.getElementById('fieldsearch').className='shown';return false;&quot;>

that should stop the submit.



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
In the future might be handy for you to know you can
just use a &quot;button&quot; then you don't have to worry about
the submit.

<input type=&quot;button&quot; value=&quot;Advanced&quot; ... ....

2b||!2b
 
ok great, now my form is not submitting i can say:

<input type=submit value=Advanced onclick=&quot;document.getElementById('fieldsearch').className='shown';return false;&quot;>

does not work and
<input type=button value=Advanced onclick=&quot;document.getElementById('fieldsearch').className='shown';&quot;>

does not work (although thanks Lrnmore for that tip)

Tracey
Remember... True happiness is not getting what you want...

Its wanting what you have got!
 
Tracey,

Just ran into Pinkee and the Drummer, said to tell you
they are in Vegas, will call you after the wedding....

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<html><head><title>TEST</title>
<script language=&quot;JavaScript&quot;>
</script>
<style type=&quot;text/css&quot;>
<!--
  .hidden{display:none;}
  .shown{display:in-line;}
-->
</style></head><body>
<input type=&quot;button&quot; value=&quot;Show&quot;
 onClick=&quot;document.getElementById('fieldsearch').className = 'shown';&quot;>
<form id=&quot;fieldsearch&quot; class='hidden'>
<input type=&quot;text&quot;></form></body></html>

2b||!2b
 
Ooops,

Please be so kind as to remove the &quot;-&quot; I put in (in-line).

Something to try, maybe you can put the &quot;fieldset&quot;
inside a &quot;div&quot; with the &quot;id&quot; fieldset and see if that
will help. Assigning the class and id to the div instead
of the fieldset. Or depending on your layout maybe use
a span, just some ideas...this is a little different.

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<html><head><title>TEST</title>
</head><body>
<input type=&quot;button&quot; value=&quot;Show&quot;
 onClick=&quot;document.getElementById('fieldsearch').style.display = 'inline';&quot;>
<form id=&quot;fieldsearch&quot; style=&quot;display:none;&quot;>
<input type=&quot;text&quot;></form></body></html>

2b||!2b
 
aahh... sorry my error

i left the form outside the fieldset class set to hidden from all my fiddling.

Must have been still hungover from the party.

Happy Yule everyone!
[cheers] [elephant2][rockband] (are back)

Tracey
Remember... True happiness is not getting what you want...

Its wanting what you have got!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top