PDA

View Full Version : Hide HTML depending on Item on page or URL



Anayet
August 1st, 2001, 09:20
Is it possible to hide a segmant of HTML automatically, if there is a certain thing on the page.

For example specific HTML will be shown on all pages except for pages that have a form field with the name "postmessage" or something.

Or if the url has a segmant in it called "showmessage", then the specific HTML will not be shown instead will be hidden.

Is this possible?

If so, please can somebody tell me how?

Thank you in advance

Anayet

meow
August 1st, 2001, 11:20
Don't know if this is what you are looking for but there is the "visibility" property in CSS (doesn't work in vers. 4 browsers, of course).
http://www.w3.org/TR/REC-CSS2/visufx.html#propdef-visibility

lucifer
August 1st, 2001, 15:16
<script>
if (condition){document.write("here is some HTML");}
</script>

Anayet
August 2nd, 2001, 06:14
Can I just copy and paste some html in the html section?

What do I write in the Condition section?
I want the html to be shown either if the url has a segmant in it called "showmessage" or if the page has a form field/text box called "postmessage".
If these are what I need, what would I have to write in the "condition"?

Thanks in advance

Anayet

lucifer
August 2nd, 2001, 06:52
Originally posted by Anayet
Can I just copy and paste some html in the html section?


yes but make all " into \"




What do I write in the Condition section?
I want the html to be shown either if the url has a segmant in it called "showmessage" or if the page has a form field/text box called "postmessage".
If these are what I need, what would I have to write in the "condition"?

Thanks in advance

Anayet

the form would need to be before the text you add

if you are dynamically adding form info can't you add the html then this would be way more efficient/better

Anayet
August 2nd, 2001, 06:59
When you say -
"into\"
What do you mean:o

What & how - do I enter in the Conditions section?


Thanks

lucifer
August 2nd, 2001, 08:25
Originally posted by Anayet
When you say -
"into\"
What do you mean:o


"<A href="mypage.html" target="_new">....</A>"

becomes
"<A href=\"mypage.html\" target=\"_new\">....</A>"


What & how - do I enter in the Conditions section?


Thanks if (name=="fred"){.....}

I can't say anymore as it depends what your conditions

as I said if you are already adding content somewhere else add the html there too