form HTML not send after click - html

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"

Related

Bootstrap form data not submitting when in modal

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.

Iissue with formsubmit.co url

i'm using formsubmit to send my emails my problem is when i submits the form google recaptcha page will open with url like https://formsubmit.co/myemail#gmail.com i wanted to change this url to my website url . is that possible???
below is my form
<form class="app_form_wrapper" action="https://formsubmit.co/myemail#gmail.com" method="POST" >
<div class="col-lg-6 text-left">
<div class="form-group apps-pulldown-20">
<div class="apps_input">
<input type="text" class="form-control" name="name" placeholder="Name"required>
</div>
</div>
<div class="form-group apps-pulldown-20">
<div class="apps_input">
<input type="email" class="form-control" name="email" placeholder="Email"required>
</div>
</div>
<div class="form-group apps-pulldown-20">
<div class="apps_input">
<input type="tel" class="form-control" name="phone" placeholder="Phone Number" minlength="10" maxlength="15"required>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group apps-pulldown-20">
<div class="apps_input">
<input type="text" class="form-control" name="company" placeholder="Company"required>
</div>
</div>
<div class="form-group apps-pulldown-20">
<div class="apps_input">
<textarea rows="10" class="form-control" name="message" placeholder="Message"required></textarea>
</div>
</div>
</div>
<input type="hidden" name="_url" value="http://localhost/app/contact">
<input type="hidden" name="_next" value="http://localhost/app/mailSent.html">
<input type="text" name="_honey" style="display:none">
<input type="hidden" name="_template" value="table">
<div class="col-lg-12">
<p>
This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
</p>
<button type="submit" class="btn btn-default btn-lg contact_btn">Send</button>
</div>
</form>
Thanks
Harshith
FormSubmit has gives you 2 different options, you can either skip the ReCaptcha page (It's not recommended but offered.) or you can replace your naked email address with a random string.
Option 1
You can use below hidden input field to skip the captcha page:
<input type="hidden" name="_captcha" value="false">
Option 2
Get a random-like string to replace your naked email address in the
action attribute of your form. Your email address will remain unknown
to spam-bots and human visitors.
This random string will send to you when you confirm your email
address.
Please also refer to their official documentation: https://formsubmit.co/documentation
I deconstructed my email address into a javascript variable so that the email address isn't hard coded into the html. This avoids spam.
//email
const email = 'youremail#youremail.com';
const encodedEmail = encodeURIComponent(email);
const url = `https://formsubmit.co/${encodedEmail}`;
<form
target="_blank"
action={url}
method="POST"
>
<input
type="email"
name="email"
className="form-control"
placeholder="Email Address"
required
/>
<button type="submit">
SUBMIT FORM
</button>
</form>

modal form not submitting

The problem is that when i click on the button nothing happens at all which it should be at least to me.
I don't need a direct answer. Just a hint, or a pointer of what can be going on.
Here is part of the code for the modal form
<div class="modal-body">
<form Method="POST" id="Signin-Form" role="form">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
<input name="txt_uname" id="txt" type="text" class="form-control input-lg" placeholder="Enter User Name" />
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></div>
<input name="txt_umail" id="email" type="text" class="form-control input-lg" placeholder="Enter Email" required data-parsley-type="email" />
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
<input name="txt_upass" id="pass1" type="password" class="form-control input-lg" placeholder="Enter Password" required data-parsley-length="[6, 10]" data-parsley-trigger="keyup" />
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
<input name="txt_upass2" id="pass2" type="password" class="form-control input-lg" placeholder="Confirm Password" required data-parsley-length="[6, 10]" data-parsley-trigger="keyup" />
</div>
</div>
<button type="submit" class="btn btn-success btn-block btn-lg"><i class="glyphicon glyphicon-open-file">CREATE ACCOUNT!</i></button>
</form>
You need to add action attribute to the form to be able to send the form-data when the form is submitted.
Sample code below
<form action="submittedpage.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
After you click submit button, the form data is sent for processing to a PHP file named "submittedpage.php". The form data is sent with the HTTP POST method.
To display the submitted data you could simply echo all the variables. The "submittedpage.php" see the code below:
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
You can see this link for more info in form handling.
https://www.w3schools.com/php/php_forms.asp
Hope this helps.

tag form in input not working outside form

This is my form:
<div class="form" method="POST" action="application/loaddata.php" id="add-item-form">
<div class="form-group">
<label class="task-label" for="task-name">name:</label>
<input type="text" class="form-control form-size" id="task-name" name="inp-name">
</div>
<div class="form-group">
<label class="task-label" for="task-email">E-mail:</label>
<input type="email" class="form-control" id="task-email" name="inp-email">
</div>
<div class="form-group">
<label class="task-label" for="task-text">text:</label>
<textarea class="form-control" id="task-text" rows="5" name="inp-text"></textarea>
</div>
</div>
My submit button, which outside from form:
<input type="submit" class="btn btn-success task-button" value="Добавить" name="do_post" form="add-item-form">
This is does not work. But if i place input="text" near submit in form, then works.
You don't actually have a form! When you write
<div class="form" method="POST" action="application/loaddata.php" id="add-item-form">
...it's just a <div>, and a <div> doesn't have a method or action attribute. You need to use actual <form> tags for the form to be valid, and to be able to use form attribute as targets for your form in other elements.
<form class="form" method="POST" action="application/loaddata.php" id="add-item-form">
<!-- Form-elements goes here -->
</form>
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form

Twitter Bootstrap base CSS

I want to put a form in my site I use base form codes from bootstrap official site but view of getbootstrap.com is very different than my view(Especially button and input view very different from the site )
HTML:
<form>
<fieldset>
<legend>dfhadfhahhf</legend>
<label>isim</label>
<input type="text" placeholder="Type something…">
</fieldset><br>
<fieldset>
<label>isim</label>
<input type="text" placeholder="Type something…">
<button type="submit" class="btn">Submit</button>
</fieldset>
<!-- Form -->
</form>
By the way I have all components of bootstrap:
<link href="static/css/bootstrap.css" rel="stylesheet">
<link href="static/css/style.css" rel="stylesheet">
where is the problem? :(
your missing some class names etc try something like
<form role="form">
<div class="form-group">
<legend>dfhadfhahhf</legend>
<label>isim</label>
<input type="text" placeholder="Type something…" class="form-control">
</div>
<br>
<div class="form-group">
<label>isim</label>
<input type="text" placeholder="Type something…" class="form-control">
<button type="submit" class="btn btn-default">Submit</button>
</div>
<!-- Form -->
</form>
for instance :
<form role="form">
and swopped your fieldset for:
<div class="form-group">
etc