Django how to give a user input for writing email text - html

I have a template for sending custom emails:
The template is as below:
<p> Type here your email: </p>
<input id="your_name" type="text" name="your_name" value="{{ mail_content }}">
{% csrf_token %}
<input type="submit" value="Send the Request " name="_add_peer_confirm">
<input type="submit" value="Go back to Standard Email " name="_">
<input type=button value="Go back" onClick="javascript:history.go(-1);">
</div>
How can I make it tidy and gives the user a longer/elongated input box where he can write his mail?
any idea?

If you are looking for a larger input box, then you could use textarea
<textarea id="your_name" type="text" name="your_name">{{ mail_content }}</textarea>

Related

What does <form action = ""> mean ? Many videos I saw assign the action attribute an empty string and I have no idea what it means

<form method="POST" action="">
{% csrf_token %}
{{ form.as_p }}
<input class="button" type="submit" value="Submit">
</form>
What will happen after I click the Submit button?
Syntax
<form action="URL">
the URL shows Where to send the form-data when the form is submitted.
Example
On submit, send the form-data to a file named "process_input.php" (to process the input):
<form action="/process_input.php" method="get">
<input type="text" id="name" name="name">
</form>
read more: https://www.w3schools.com/tags/att_form_action.asp

Mail-based submission : Does not show in the body of the email

I have created a simple form (mail-based submission). However, when I submit and when I am directed to the mail app, I don't see the text I have input to the "First Name" and "Surname" box. Is there anything wrong with my code?
<form action="mailto:someone#mail.com" method="post" enctype="text/plain">
First name: <input type="text" name="firstname" /> <br/>
Surname: <input type="text" name="surname" /> <br/>
<input type="submit" value="Submit now" />
</form>

How to make a html form email results

I made a html form and want it to email the results to me, so I can evaluate the answer and later add it to my website. i want the email to somewhat look like this:
name: name
email: EMAIL
title: title
messige: massige
current program:
<!DOCTYPE html>
<html>
</body>
<form>
name<br>
<input type="text" name="name" id="user_input"><br>
email<br>
<input type="email" name="email" id="user_input"><br>
title<br>
<input type="text" name="title" id="user_input"><br>
message<br>
<textarea id="msg" name="user_message"></textarea>
</form>
<div class="button">
<button type="submit">submit</button>
</div>
</body>
</html>
If you don't want to use PHP/ Node.js/another technology, you can use the Formspree API. Your html would look like this:
<form action="https://formspree.io/your#email.com" method="POST">
<input type="text" name="name">
<input type="email" name="_replyto">
<input type="submit" value="Send">
</form>
And you sign up for an account here: https://formspree.io/ . You will receive form submissions in your inbox.
Another alternative is to add a "mailto" link instead of the full contact form. This creates a link that opens the user's default email system (ie gmail/outlook/mail) and lets them email you from their inbox. The "%0D%0A%0D%0A" part creates a new line in the email:
<a href="mailto:YOUREMAIL#gmail.com?subject=Hello&body=Hello Owen,%0D%0A%0D%0AI'm interested in xyz thing on your website%0D%0A%0D%0A" target="_blank">

Form not taking action

I have a problem with a form. It is not sending any action (page not even refreshing on click). If I copy the form in another document locally it has no problem, all working well, mail message being sent. Here is the code of the form:
<form method='post' name='ContactForm' id='contactForm' action='contact_main.php'>
<p>Your name:</p>
<input type="text" class="input-box" name="user-name" placeholder="Please enter your name.">
<p>Email address:</p>
<input type="text" class="input-box" name="user-email" placeholder="Please enter your email address.">
<p>Subject:</p>
<input type="text" class="input-box" name="user-subject" placeholder="Purpose of this message.">
<p class="right-message-box">Message:</p>
<textarea class="input-box right-message-box message-box" name="user-message" placeholder="Your message."></textarea>
<button type='submit' class='myinputbtn' name='submitf' id="submitf">Send your message</button>
<div id='message_post'></div>
<input type="hidden" name="contact">
</form>
Clicking the submit button results in... nothing!
Please let me know if I need to edit my question before downrating. Thanks!
Use
<input type="submit" ...
instead of a button (which is used with Javascript, not for form submitting)

Submitted Form not POSTing Data (except for submit=>Submit )

I have been trying to submit data with a form to some php code. The code gets $_POST['sumbit'] == 'Submit' but nothing else.
Example:
<form id="ucp" method="post" action="./ucp.php?i=nhl&mode=nhl">
<fieldset class="fields2">
<dl>
<dt><label for="teamname">Team Name:</label></dt>
<dd><input type="text" maxlength="25" id="teamname"></dd>
</dl>
<fieldset class="submit-buttons">
<input type="reset" value="Reset" name="reset" class="button2" />
<input type="submit" name="submit" value="Submit" class="button1"/>
</fieldset>
</form>
PHP:
http_build_query($_POST) == "submit=Submit" || ""
Forms need inputs with NAMEs, IDs will not work. Any input field without a name attribute does not send data.