How can I disable a submit button in an HTML form? - html

I have a form where users can contact me but it is currently broken. I was wondering if there is a way to temporarily disable the submit button, but still show it on the screen. How do I achieve this?
<form method="post" action="#">
<div class="row 50%">
<div class="6u"><input type="text" name="name" placeholder="Name" /></div>
<div class="6u"><input type="email" name="email" placeholder="Email" /></div>
</div>
<div class="row 50%">
<div class="12u"><textarea name="message" placeholder="Message" rows="6"></textarea></div>
</div>
<div class="row">
<div class="12u">
<ul class="actions">
<li><input type="submit" value="Send Message" /></li>
<li><input type="Reset" value="Clear" /></li>
</ul>
</div>
</div>
</form>

<input type="submit" value="Send Message" disabled>
Thanks APAD1

Related

How to get the submit button to send directly to my email HTML CSS

I've created a contact form on a HTML website but not sure how I can make sure the form sends the queries only to my address.
<section id="contact-form">
<form>
<div class="contact-left">
<h1 class="c-l-heading">
<font style="border-bottom: 3px solid #FFC966;">Email</font> me</h1>
<div class="f-name">
<font>Name</font>
<input type="text" placeholder="Full Name" />
</div>
<div class="f-email">
<font>Email</font>
<input type="email" placeholder="Example#gmail.com" />
</div>
</div>
<div class="contact-right">
<div class="message">
<font>Message</font>
<textarea name="message" rows="5" cols="20" placeholder="Write Message..."></textarea>
</div>
<button>submit</button>
</div>
</form>
</section>
Add form method and action:
<form action="mailto:someone#example.com" method="post" enctype="text/plain"/>
submit must be like this:
<input type="submit" value="submit"/>

form not submitting on localhost or remote

After submitting the form nothing happens, page doesn't reloads. Out of ideas.
<form action="/departmentinsert.php" method="POST" class="contact-form">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<input class="form-control" id="name" name="name" placeholder="Отделение" type="text">
</div>
</div>
</div>
<div class="col-md-12">
<div class="row">
<button type="submit" name="submit" id="submit">
Добавить <i class="fa fa-paper-plane"></i>
</button>
</div>
</div>
</div>
</form>
to submit the form you will need to use <input type="submit"> instead of the <button> tag
once you update the code I am sure it will work, if you are using PHP it should be like this
<?php
if(isset($_POST['submit']){
// your code
}
?>
if this doesn't work please post your PHP as well so i can check where's the problem
hope this help.
I changed formatting to and it works now. My code now is
<form action="" method="POST" >
<div class="form-group">
<input class="form-group" id="name" name="name" placeholder="Отделение" type="text">
</div>
<div class="form-group">
<input class="form-group" id="title" name="title" placeholder="Заголовок" type="text" size="255">
</div>
<div class="form-group">
<input class="form-group" id="breadcrumb" name="breadcrumb" placeholder="Хлебные крошки" type="text" size="255">
</div>
<div class="form-group">
<input class="form-group" id="pagetitle" name="pagetitle" placeholder="Титул страницы" type="text" size="255">
</div>
<div class="form-group">
Опубликовать?
<input name="active" type="checkbox" value="1" checked>
</div>
<div class="form-group">
<button type="submit" name="submit" id="submit">
Добавить <i class="fa fa-paper-plane"></i>
</button>
</div>
</form>

how to make mailto: code work in custom submission for template?

So i was given a custom submission form HTML and CSS code template as shown below
I want to add the HTML mailto: script, so that anytime a employee enters a ticket, it will send to our help desk ticket email. My issue is i am completely lost on where to put it in the code itself so that when they click the submit now icon, it will send to the given address.
<!-- Main -->
<section id="main" class="container 75%">
<header>
<h2>Help Desk Ticket</h2>
<p>Submit a Help Desk Ticket to IT</p>
</header>
<div class="box">
<form method="post" action="#">
<div class="row uniform 50%">
<div class="6u 12u(mobilep)">
<input type="text" name="name" id="name" value="" placeholder="Name" />
</div>
<div class="6u 12u(mobilep)">
<input type="email" name="email" id="email" value="" placeholder="Email" />
</div>
</div>
<div class="row uniform 50%">
<div class="12u">
<input type="text" name="subject" id="subject" value="" placeholder="Subject" />
</div>
</div>
<div class="row uniform 50%">
<div class="12u">
<textarea name="message" id="message" placeholder="Description of Problem" rows="6"></textarea>
</div>
</div>
<div class="row uniform">
<div class="12u">
<ul class="actions align-center">
<li></a><input type="submit" value="Submit Ticket" /></li>
</ul>
</div>
</div>
</form>
</div>
</section>
All i want is for them to be able to click "submit ticket" and it will send to our company IT help desk email.
change this
<form method="post" action="#">
to this
<form action="mailto:someone#example.com" method="post" enctype="text/plain">
editing the email address with the recipient you want to send the mail to

Form Code Missing Something?

First time posting here on Stackoverflow, can you guys tell me what's missing with this code? It's supposed to be a form but the "Submit" button does nothing. Thanks!
<div class="container">
<span class="reg"> <h1>Register Now</h1> </span>
<div class="row">
<div class="conent-part">
<div class="form-body">
<div class="fome-body">
<form>
<div class="row">
<div class="form-part">
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Your Name">
</div>
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Your Email Address">
</div>
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Nominee's Name">
</div>
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Nominee's Email">
</div>
</div>
<div class="form-part">
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Nominee's Sport">
</div>
<div class="form-group">
<textarea class="form-control" rows="3" placeholder="Accomplishments"></textarea>
</div>
</div>
</div>
<div class="custom_btn">
<button type="button" class="btn btn-primary btn2">Submit</button>
</div>
</form>
Change
<div class="custom_btn">
<button type="button" class="btn btn-primary btn2">Submit</button>
</div>
To
<div class="custom_btn">
<button type="submit" class="btn btn-primary btn2">Submit</button>
</div>
By just typing type=button you're just telling us that its a button without stating a function for it.The type="submit" will automatically submit the form to the specified URL.
<button type="button">
has no default behaviour, if you want to submit the form you'd just use <button> without the type attribute defined (submit is the default value).
See the docs for more info.

HTML: How can I align this form?

I have a form in my code, but it's off to the left side of the page. I don't know how to align it.
<form method="post" action="#">
<div class="5grid">
<div class="row">
<div class="6u">
<input type="text" name="name" id="name" placeholder="Name">
</div>
<div class="6u">
<input type="text" name="email" id="email" placeholder="Email">
</div>
</div>
<div class="row">
<div class="12u">
<input type="text" name="subject" id="subject" placeholder="Subject">
</div>
</div>
<div class="row">
<div class="12u">
<textarea name="message" id="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<input type="submit" class="button" value="Send Message">
<input type="reset" class="button button-alt" value="Clear Form">
</div>
</div>
</div>
</form>
And it looks like this :
Any help appreciated.
If you just want it horizontally centered, put your form inside a width-limited div parent, and a doc-wide div grandparent with centered content:
<div style="text-align: center">
<div style="width: 400px; text-align: left;">
<form ...
...
</form>
</div>
</div>
<style media="screen" type="text/css">
form {
width: 400px;
margin: 0 auto;
}
</style>
<form method="post" action="#">
<div class="5grid">
<div class="row">
<div class="6u">
<input type="text" name="name" id="name" placeholder="Name">
</div>
<div class="6u">
<input type="text" name="email" id="email" placeholder="Email">
</div>
</div>
<div class="row">
<div class="12u">
<input type="text" name="subject" id="subject" placeholder="Subject">
</div>
</div>
<div class="row">
<div class="12u">
<textarea name="message" id="message" placeholder="Message"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<input type="submit" class="button" value="Send Message">
<input type="reset" class="button button-alt" value="Clear Form">
</div>
</div>
</div>
</form>
This should work