Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I made bootstrap a form with this code and i am loosing my mind, not knowind why upon submitting is doing a GET method and redirecting to
tables.php?type=addTable&tablename=test&tablenumber=4#
And not to: essentials/settings-bar.php
<form action="essentials/settings-bar.php" method="post">
<input type="hidden" id="method" name="type" value="addTable">
<input
type="text" class="form-control col text-center m-1"
id="tablename" name="tablename"
placeholder="Table name"><br>
<input type="text"
class="form-control col text-center m-1" id="tablenumber"
name="tablenumber"
placeholder="Table number""><br>
<input type="submit" class="btn btn-primary m-2" value="Add table">
</form>
There was an unwanted hidden in the code, that i forgot about it
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
this is some stupid but i dont know.
How i can export the action to two differents sections from submit button?
I want the cancel button to take me to one page and the accept button to take me to another. How can I apply a conditional that takes different actions?
My buttons are Accept and Cancel...
<section>
<form action="/news">
<input type="submit" id="button" value="Accept"> <input type="submit" class="button2" value="Cancel">
</form>
</section>
<!doctype html>
<html>
<head>
</head>
<body>
<form action="submit.html">
<label for="name">Name</label>
<input type="text" name="name">
<label for="lastname">Last Name</label>
<input type="text" name="lastname">
<button type="submit" id="submit">submit</button>
<button type="cancel" formaction="cancel.html">cancel</button>
</form>
</body>
</html>
Basically with html you can make different action in form like this
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have simple email script with few forms and I am getting duplicate submissions...
So, what is the easiest way to prevent duplicate submissions?
My code..
<form action="main_contact.php" method="post" name="contact_form">
<input type="text" name="contact_name" placeholder="Name">
<input type="email" name="contact_email" placeholder="Email">
<input type="text" name="contact_subject" placeholder="Subject">
<textarea cols="30" name="contact_message" rows="10" placeholder="Your Message"></textarea>
<input type="submit" value="Send">
</form>
<?php
if(isset($_POST['contact_form'])){
var_dump($_POST);
}
?>
You can use jQuery to disable submit button after the form has been submitted:
$('form[name="contact_form"]').submit(function(){
$(this).find('input[type="submit"]').prop('disabled', true);
});
you just need to disable or make visibility hidden after just click on submit button. fist give a id to the submit button
<input type="submit" value="Send" id="sub_id">
and then make it hidden or disable in javascript once you submit the form
document.getElementById('sub_id').style.visibility='hidden';
If you used any framework like Laravel5 or Symfony you would get it "out of the box".
In short:
Register a session token and invalidate it after first form submission.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
At the bottom of my site, I have a sign up form. I can't make the button to be on the same line and close to that the email.
It already has a class assigned, so it's just about the css, but I'm no expert on css :(
Here is the HTML Code:
<div class="mc4wp-form-fields"><h1 align="center">
Want to hear updates on the future releases?
</h1><br>
<input type="email" name="EMAIL" placeholder="Your email address" class="signup" required="">
<input type="submit" value="Sign up" class="signup_button">
Any Idea how to do it???
Your input has a width of 100% - therefore taking 100% of the container.
input[type="email"] { width:/*something thats not 100%*/ }
You could float them, providing neither is set to 100% width...
<input style="float:left;" type="email" name="EMAIL" ....
<input style="float:right;" type="submit" value="Sign up" ....
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
When I click in my newsletter subscribe button in my footer Im going to the top of my page.
I can have my sucess message my error messages but Im going always to the top of my page. And I dont want this because I want that usre see the feedback message without scroll down to my footer.
Do you see why this happening and how can I fix this?
<form action="" name="newsletter" method="post" enctype="multipart/form-data">
<div id="email_newsletter_container">
<input type="text" id="email" value="<?php if(isset($_POST['email'])) echo $email; ?>" name="email" placeholder="Insert your email..." required/>
<input type="hidden" name="newsl_sub" value="subscribe" />
<button class="btnn" type="submit" name="subscribe"><span>Subscribe</span></button>
</div>
</form>
When you put action="" the action will reload the page. If you put action="#newsletter" it should take the user to the section of the page that contains the form when the form is submitted. You may also want to add id="newsletter" to the form to ensure compatibilities.
<? if($post_was_submitted_and_comment_was_inserted) { ?>
<script>
window.addEventListener("load", function(){
document.getElementById("comments").scrollIntoView();
});
</script>
<? } ?>
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I'm a complete noob about web development. I have an one page HTML template that I was trying to edit as per my requirements. It has a contact form that I want people to use to send me an email. I set my email address as $to, but when I was testing the contact form, it didn't send an email to my address. Rather than that, it took me to the page contact.php and I could see all the html and php code. I'm attaching the codes for the contact form. Can anyone tell me what could possibly go wrong and how to fix this issue? Thanks in advance.
HTML Code:
<form id="contact-form" name="contact-form" method="post" action="contact.php">
<div class="row-fluid">
<p class="span6"><input id="username" name="username" type="text" tabindex="1" value="" placeholder="Name (required)"></p>
<p class="span6"><input id="email" name="email" type="text" tabindex="2" value="" placeholder="E-mail (required)"></p>
</div>
<div class="row">
<p class="span6"><textarea id="message" name="message" tabindex="4" rows="6" placeholder="Message (required)"></textarea></p>
</div>
<div class="row">
<div class="span2">
<button id="sending" type="submit" class="btn btn-embossed btn-large btn-primary" data-send="Sending...">Submit</button>
</div>
</div>
</form>
PHP Code:
(Note to the author: You can start your PHP code below:)
<?php
?>
Please click on the link to see the code. I can't post an image as I am new here. http://i.stack.imgur.com/QPHYH.jpg
It sounds like your server is not processing PHP correctly. There's nothing wrong with your HTML form, assuming contact.php is indeed the action page you want - you just need to get your server/computer to handle PHP properly. Check this answer for more info.