Template:MMGForm: Difference between revisions

From Melvor Idle
(Created page with "<includeonly> <form> <input type="text" name="subpageTitle" id="subpageTitle" placeholder="Enter subpage title"> <input type="button" value="Create Guide" onclick="createSubpage()"> </form> <script> function createSubpage() { var subpageTitle = document.getElementById('subpageTitle').value; if (subpageTitle.trim() === '') { alert('Please enter a subpage title.'); return; } var encodedTitle = encodeURIComponent(subpageTitle.trim())...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{rfd|Doesn't work. Inputbox extension does what this should have.}}
<includeonly>
<includeonly>
<form>
<form>
     <input type="text" name="subpageTitle" id="subpageTitle" placeholder="Enter subpage title">
     <input type="text" name="subpageTitle" id="subpageTitle" placeholder="">
     <input type="button" value="Create Guide" onclick="createSubpage()">
     <input type="button" value="Create a new guide" onclick="createSubpage()">
</form>
</form>


Line 9: Line 10:
     var subpageTitle = document.getElementById('subpageTitle').value;
     var subpageTitle = document.getElementById('subpageTitle').value;
     if (subpageTitle.trim() === '') {
     if (subpageTitle.trim() === '') {
         alert('Please enter a subpage title.');
         alert('Please enter a guide name.');
         return;
         return;
     }
     }
     var encodedTitle = encodeURIComponent(subpageTitle.trim());
     var encodedTitle = encodeURIComponent(subpageTitle.trim());
     var link = '{{fullurl:{{FULLPAGENAME}}/' + encodedTitle + '|action=edit&preload=Template:MoneyMakingGuide}}';
     var link = '{{fullurl:Money Making/' + encodedTitle + '|action=edit&preload=Template:MoneyMakingGuide/preload}}';
     window.location.href = link;
     window.location.href = link;
}
}
</script>
</script>
</includeonly><noinclude>{{/doc}}</noinclude>
</includeonly><noinclude>{{/doc}}</noinclude>

Latest revision as of 15:43, 17 June 2024

This template allows users to input a name for a new money making guide, and the creation of the subpage under Money Making. The data from the Template:MoneyMakingGuide is automatically placed on the page for the user to fill out.