Bootstrap form data not submitting when in modal - html

I have the following form:
<form action="../util/vcput.php" method="POST">
<input name="vockey" type="hidden" value="<?php echo getCsrfToken(); ?>">
<input name="a" value="addorgadmin" type="hidden">
<input name="m" value="editorg" type="hidden">
<input name="q1" value="orgid=<?php echo $org->id; ?>&orgadmins=1" type="hidden">
<input type="hidden" name="orgid" value="<?php echo $org->id; ?>">
<div class="container-fluid mt-3">
<div class="row">
<div class="col-5">
<input class="form-control" type="text" placeholder="Email" id="userEmail" name="userEmail" aria-label="New Admin Email"></input>
</div>
<div class="col-4">
<input class="form-control" type="text" placeholder="Name" id="userName" name="userName" aria-label="New Admin Name"></input>
</div>
<div class="col-3">
<!-- <button type="submit" class="btn btn-primary">Add admin</button> -->
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Add admin</button>
</form>
However, when clicking the submit button nothing happens, no data is submitted/no action is taken. I know that the name/id values are correct, as the lines are copied over from an older version of the page (modified to bootstrap v5).
Am I doing something wrong here? The form is in in a modal-body and doesn't work, but works when outside.
EDIT: Figured it out... I had a form tag enclosing the entire page that I had forgotten about, so having this form nested was breaking functionality. Oops.

Figured it out... I had a form tag enclosing the entire page that I had forgotten about, so having this form nested was breaking functionality. Oops.

Related

form HTML not send after click

Im use form html my probleme after click submit send nothing in my brother
<form method="get" id="booking-form" role="form" action="">
<div class="col-md-3 col-sm-6">
<i class="fa fa-map-marker rechercheIndex"></i>
<label class="sr-only" >Recherche</label>
<input type="text" class="form-control" placeholder="Ville">
</div>
<div class="col-md-2 col-sm-4">
<input type="submit" class="btn btn-primary btn-block" >
</div>
</form>
After click button send nothing
Im expetected return value in my form
I found solution. Just add name in my input name="city"
<label for="city">Enter city: </label>
<input type="text" class="form-control" placeholder="Ville" name="ville">
set Action Attribute to specific Action Page
you should must PHP or other server side language to interact with forms
Index.php
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
</body>
</html>
Welcome.php
<html>
<body>
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
</body>
</html>
In first line ,we need to give path were form get collect
Ex :-
In this the form get collect in "/action_page.php"

Form redirect to same page, but showing that not exist

Hello I have a really strange problem with html form. I am using Wordpress and I created my custom html form. When i submit the form it redirects me on the same page url, but showing me that the page doesnt exist.
My form:
<form action="" method="post">
<div class="form-group">
<input type="text" name="name" class="form-control input-text" placeholder="Vaše jméno a příjmení" />
<div class="validation"></div>
</div>
<div class="form-group">
<input type="email" class="form-control input-text" name="email" placeholder="Váš e-mail" />
<div class="validation"></div>
</div>
<div class="form-group">
<input type="text" class="form-control input-text" name="subject" placeholder="Předmět zprávy" />
<div class="validation"></div>
</div>
<div class="form-group">
<textarea class="form-control input-text text-area" name="message" rows="5" placeholder="Vaše zpráva pro nás..."></textarea>
<div class="validation"></div>
</div>
<div class="row">
<!-- Google reCAPTCHA widget -->
<div class="col-lg-8 col-sm-8">
<!-- recaptcha here -->
</div>
<div class="col-lg-4 col-sm-4" style="padding-right: 0; padding-left: 0;">
<div class="text-center" style="margin-right: 7px;"><button name="submit" style="width: 135px; height: 75px; padding:0 !important;" type="submit" class="input-btn">Odeslat</button></div>
</div>
</div>
</form>
I tried to hide all my php code behind, also hide google recaptcha, but nothing works and the problem is elsewhere. My action is also empty, just set method.
What is wrong, any suggestions?
You have to change the name of your field name="name" to something else.
for more information you can read here
https://wordpress.stackexchange.com/questions/11749/why-when-i-submit-a-form-in-wordpress-it-loads-a-404-page-though-url-is-correct
Perhaps the problem is the submit button.
When you create a form, the submit button is an input as well.
You may try
<input type="submit" value="submit" yourtags="yourvalue">
See https://www.w3schools.com/html/html_forms.asp for more data.
EDIT: if you are trying to send the action to the same page, omit the action attribute. Perhaps leaving it blank causes an error.

Form not submitting values inside <div>

I am working with Laravel 5.4 Framework and I get this issue when the form does not submit anything except the csrf_token().
If I put an input outside of those <div> it will work and submit it, otherwise the browser (Chrome) will only submit the token, as if everything inside the <div> is not part of the form.
How can I submit all the data while using Bootstrap's form-group divs? The layout is not the problem as it does not work even when removing it.
#extends('layouts.master')
#section('content')
<div class="container" style="margin-top: 1%">
<p>Welcome, {{$user->name}}, here you can submit a new company for our database.</p>
<form name="suggestCompanyForm" method="post">
{{csrf_field()}}
<div class="form-group">
<label for="companyName">Company Name</label>
<input type="text" class="form-control" id="companyName" aria-describedby="companyNameHelp" placeholder="Enter company name">
<small id="companyNameHelp" class="form-text text-muted">Enter the company's name you would like to suggest</small>
</div>
<div class="form-group">
<label for="companyEmail">Email address</label>
<input type="email" class="form-control" id="companyEmail" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">Enter the company contact email.</small>
</div>
<div class="form-group">
<label for="selectCategory">Select main category</label>
<select class="form-control" id="selectCategory">
<option>Food&Drink</option>
<option>Cosmetics</option>
<option>Electronics</option>
<option>Consumer Goods</option>
<option>Services</option>
</select>
</div>
<div class="form-group">
<label for="description">Company description.</label>
<textarea class="form-control" id="description" rows="5"></textarea>
</div>
<div class="form-group">
<label for="logo">File input</label>
<input type="file" class="form-control-file" id="logo" aria-describedby="logoHelp">
<small id="fileHelp" class="form-text text-muted">Add company logo.</small>
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" id="check" class="form-check-input">
I agree that my submission follows the website rules.
</label>
</div>
<button id="submitCompany" type="submit" class="btn btn-primary" >Submit</button>
</form>
</div>
#endsection
your form inputs are not being submitted because you didn't give them names ...
Try
<textarea class="form-control" name="description" id="description" rows="5"></textarea>
You have to add the action attribute to the form tag.
Edit this line
<form name="suggestCompanyForm" method="post">
to
<form name="suggestCompanyForm" action = "<url-for-the-submission>" method="post">
.You will also need to add this
name="name_of_input_to_submit"
to each input not only the textarea and you are also uploading a file you have to add this to the form tag too.
enctype="multipart/form-data"

Making the _next option work in Formspree

I'm working on a contact form for a static website at www.peek.solutions. The contact form works, in that I'm (after confirmation of my e-mail address) able to receive e-mails at the given address. Here is the code used:
<form id="contactform" action="//formspree.io/kurt.peek#gmail.com" method="POST">
<div class="col-sm-7 slideanim">
<div class="row">
<div class="col-sm-6 form-group">
<input class="form-control" id="name" name="name" placeholder="Name" type="text" required>
</div>
<div class="col-sm-6 form-group">
<input class="form-control" id="email" name="_replyto" placeholder="Email" type="email" required>
</div>
</div>
<textarea class="form-control" id="comments" name="message" placeholder="Message" rows="5"></textarea><br>
<div class="row">
<div class="col-sm-12 form-group">
<button class="btn btn-default pull-right" type="submit">Send</button>
</div>
</div>
</div>
<input type="hidden" name="_next" value="//peek.solutions/confirmation.html" />
<input type="text" name="_gotcha" style="display:none" />
</form>
The problem is that when I submit the form by pressing the "Submit" button, I'm redirected to Formspree's default confirmation page:
However, through the line
<input type="hidden" name="_next" value="//peek.solutions/confirmation.html" />
I was trying to make this confirmation page default to www.peek.solutions/confirmation.html. As far as I can tell, this line follows the documentation at https://formspree.io/. Can anyone tell why this is not working?
Updating your URLs to include http: will fix the issue. so for the _next value it should be http://peek.solutions/confirmation.html,
To prevent exposing your email, and using the now legacy method of using your email in forms, you can sign up for a free Formspree account and generate a custom endpoint. More info on legacy forms can be found here.

Won't submit login details

I'm trying to get our login portal working, but for some reason it won't accept the login details. It just won't submit the information, it just refreshes the page.
Any ideas would be extremely appreciated on how to fix this.
Many thanks!
<div id="nav">
<ul>
<li id="login">
<a id="login-trigger" href="#">
Log In <span>▼</span>
</a>
<div id="login-content">
<form>
<form action="https://na6.salesforce.com/secur/login_portal.jsp" method="POST">
<input type="hidden" value="00D80000000anEa" name="orgId">
<input type="hidden" value="060800000006ANB" name="portalId">
<input type="hidden" value="true" name="useSecure">
<input type="hidden" value="2" name="loginType">
<input type="hidden" name="action" value="loginAction">
<fieldset id="inputs">
<input id="txtUserIdGutter" class="InputText" type="text" name="Email" placeholder="Your email address" required>
<input id="txtPasswordGutter" class="InputText" type="password" name="Password" placeholder="Password" required>
</fieldset>
<fieldset id="actions">
<input type="submit" id="submit" value="Log in">
<label><input type="checkbox" checked="checked"> Keep me signed in</label>
<label>Forgot Password?</label>
</fieldset>
</form>
</div>
</li>
</ul>
</div>
Take out your extra <form> tag.
<div id="login-content">
<!-- Remove this line: --> <form>
<form action="https://na6.salesforce.com/secur/login_portal.jsp" method="POST">
When the page refreshes, it's supposed to hit your code behind.
Do you have a log line or a breakpoint that you expect your code to be called?
Also, you have double form tags:
<form><form action="https://na6.salesforce....
Try to remove the first one.