Module:Contact: Difference between revisions
Appearance
Created page with "local p = {} function p.form( frame ) local username = mw.title.getCurrentTitle().getText() -- Get the current username (assumes the user is logged in) local subject = frame.args.subject or "" -- Get the subject input, if present local message = frame.args.message or "" -- Get the message input, if present -- Create a simple form for submitting the message return string.format([[ <form action="/w/index.php" method="post"> <input type=..." |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p.form(frame) | |||
<form action="/ | local username = mw.title.getCurrentTitle().text | ||
<label for="subject">Subject:</label> | local formHtml = '<form action="/wiki/Contact" method="POST">' .. | ||
<input type="text" | '<label for="subject">Subject:</label>' .. | ||
'<input type="text" id="subject" name="subject" required><br>' .. | |||
<label for="message">Message:</label> | '<label for="message">Message:</label>' .. | ||
<textarea name="message" required> | '<textarea id="message" name="message" required></textarea><br>' .. | ||
'<input type="hidden" name="username" value="' .. username .. '">' .. | |||
<input type=" | '<button type="submit">Send</button>' .. | ||
'</form>' | |||
return formHtml | |||
end | end | ||
return p | return p |
Latest revision as of 23:47, 3 January 2025
Documentation for this module may be created at Module:Contact/doc
local p = {}
function p.form(frame)
local username = mw.title.getCurrentTitle().text
local formHtml = '<form action="/wiki/Contact" method="POST">' ..
'<label for="subject">Subject:</label>' ..
'<input type="text" id="subject" name="subject" required><br>' ..
'<label for="message">Message:</label>' ..
'<textarea id="message" name="message" required></textarea><br>' ..
'<input type="hidden" name="username" value="' .. username .. '">' ..
'<button type="submit">Send</button>' ..
'</form>'
return formHtml
end
return p