I have the existing code:
<form action="page.php?id=<?= $_GET['id'] ?>" method="post">
<fieldset>
<p id="edit_name"><label for="name">Page Name:</label><input type="text" name="name" value="<?PHP echo htmlspecialchars_decode($s->name);?>" id="name"> <input type="submit" src="../img/button_save.jpg" name="btnSubmit" value="Save" id="btnSubmit" class="submit"></p>
<div id="show_name"<?= $_GET['edit'] ? ' style=" display: none"' : '' ?>><p><label for="name">Page Name:</label> <?PHP echo $s->name;?> <a href="?id=<?= $_GET['id'] ?>&edit_name=1" onClick="$('edit_name').show(); $('show_name').hide(); return false;"><img style="vertical-align: top;" src="../img/button_change.png" alt="Change Name"></a></p></div>
<?
// for non-JS browsers
if(!$_GET['edit']) {
?>
<script type="text/javascript">
$('edit_name').hide();
</script>
<?
}
?>
</fieldset>
</form>
I want to also set focus to the input box on clicking change. Currently it just shows/hides upon clicking change.
Thanks!