My Newpage

Create a new page with the date before page name

Source

<html>
<body>
    <form name="newpageForm">
        <input type="text" name="newpage" value="" onkeydown="if (event.keyCode == 13) document.getElementById('btnSubmit').click()"/>
        <input type="button" id="btnSubmit" value="Create new page" onclick="create()"/>
    </form>
    <script type="text/javascript">
        <!--
        var d = new Date();
        var curr_date = d.getDate();
        var curr_month = d.getMonth() + 1;
        var curr_year = d.getFullYear();
 
        function create() {
        var url  = 'http://bmcenterprises.wikidot.com/css3:';
        var input = document.newpageForm.newpage.value;
        var edit = '/edit/true/title/';
        var append = '/';
 
        window.open(url + curr_year + '-' + curr_month + '-' + curr_date + '-' + input + edit + input + append);
        }
        //-->
    </script>
<body>
</html>

Discussion

No comments yet. Start the discussion…1 comments

07 Jul 2014 01:49

Great !!
- Just what I needed !!
(but only without the text box)
;-)

Thank you !!

Edit

Add a new comment

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License