Hi Guys,
I'm very new to PHP. I've a quick Q..how can I show/hide a div(the div has id) in the code behide..I mean after posting the page.
Thanks,
M
How to show/hide a div after post
Moderator: General Moderators
-
Phoenixheart
- Forum Contributor
- Posts: 123
- Joined: Tue Nov 16, 2004 7:46 am
- Contact:
Re: How to show/hide a div after post
In your PHP code, check for $_POST. If it's not empty, your page is posted. Set the div's display style to none then.
Re: How to show/hide a div after post
I understood what you said, but could you please tell me..how to access the element with ID..do we have getElementByID or $('#Id')..Jquery notation
and then, how can I set the css attribute.?? Please let me know?
Thanks Phoenixheart.
and then, how can I set the css attribute.?? Please let me know?
Thanks Phoenixheart.
Re: How to show/hide a div after post
Not 100% sure what you mean, but try this:
Code: Select all
<? if(isset($_POST['name-of-form'])) { ?>
<style type="text/css">
#id-of-div { display: none; }
</style>
<? } ?>