Below is a form which would appear no matter javascript is enabled or disabled.
<?php
if (logged_in()) {
echo "
<form method='post' name='form' action='' class='oldform'>
<textarea name='content' id='content' ></textarea>
<input type='submit' value='post' name='submit'/>
</form>";
}
?>
Now I want to replace the above form with another form when javascript is enabled complying with the logged_in php code. I think code below will hide old form and display new form but I am not able to get how to put script in echo so when javascript is enabled <script>
replaces old form with new.
<script>
<style>
.oldform{display:none;}
</style>
<form name="newform">
</form>
<script>