I have some strange thing happening from my self post forms. I thought using form method="post" would not put data in the url. And I'm having different outcomes on both forms
<form method="post" action="" enctype="multipart/form-data" id="testForm">
<div class="form-group">
<div class="panel-heading">
some junk
</div>
<div class="panel-body">
<div class="col-md-12">
<textarea id="summernote" name="Full_Discription" class="form-control" required></textarea>
</div>
<div class="col-md-1">
<input type='hidden' name='var' value='<?php echo "$Known_Issue_id";?>'/>
<button name="submit" type="submit" id="submitButton" class="btn btn-accent">Submit Follow-up</button>
</div>
</div>
</div>
</form>
If I submit this form the hidden data shows in URL but not the body text from summernot
web_known_issues_bug.php?bug=20
<form method="post" enctype="multipart/form-data" id="testForm">
<div class="form-group">
<div class="col-md-2">
<label>Website Issue Type:</label>
<select class="form-control" name="Issue_Plugin" id="Issue_Plugin" required>
<option value="">- Select Web Issue -</option>
</select>
</div>
<div class="col-md-7">
<label>Description Of Known Issue:</label> <input name="Issue_Discription" type="text" value="" class="form-control" required>
</div>
<div class="col-md-2">
<label>Type Of Issue:</label>
<select class="form-control" name="Issue_Type" id="Issue_Type" required>
<option value="">- Bug Type -</option>
</select>
</div>
<div class="col-md-1">
<label>Submit Issue</label><BR>
<input type='hidden' name='bug' value='<?php echo "none";?>'/>
<button name="submit" type="submit" id="submitButton" class="btn btn-accent">Submit Issue</button>
</div>
<div class="col-md-12">
<textarea id="summernote" name="Full_Discription" class="form-control" required><?php echo $SendBody; ?></textarea>
</div>
</div>
This form is spitting everything to the url?
web_known_issues.php?message=Added%20New%20Bug%20List%20Item&title=Siclone%20Crashes%20when%20not%20used%20everyday&full=asdasdasdasdasd
I really need this stuff to send clean urls. Any idea on what I have done wrong?
Sorry, this is solved. My error, I left in some debug code in the miles of PHP
Related
I can see the title to be edited but the question is how can I view a detailed bar for editing? in the tutorials, I am following works correctly but with me, it doesn't.
'{{#each errors }}
<div class="alert alert-danger">{{text}}</div>
{{else}}
{{/each}}
<div class="card card-body">
<h3>Edit Candidates</h3>
<form action="/ideas" method="post">
<div class="form-group">
<label for="title">Title</label>
<input type="text" class="form-control" name="title" value="{{idea.title}}" required>
</div>
<div class="form-group">
<label for="details">Details</label>
<textarea class="form-control" name="details" required {{idea.details}}></textarea>
</div>
<button type="submit" class="btn btn-primary">submit</button>
</form>
</div>'
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>
Unable to get ths form working.
Is there any easy to create html form that will simply send email upon submission?
Can anyone provide some code samples?
I tried to get it workin but it always stay there no response on email. In form i tried to get date, time, locations that can be typed, number passanger and cars, car type, name email and message.
<form class="booking-form">
<div class="row">
<!-- <div class="col-xs-6 col-sm-2">
<fieldset class="car-type">
<input type="checkbox" name="car-type" id="econo" />
<label for="econo"><i class="icon-car-econo"></i>Econo</label>
</fieldset>
</div> -->
<div class="col-xs-6 col-sm-2">
<fieldset class="car-type">
<input type="checkbox" name="car-tclass="icon-car-LUXURY SEDANype" id="LUXURY SEDAN" />
<label for="LUXURY SEDAN"><i class="icon-car-classic"> </i>LUXURY SEDAN</label>
</fieldset>
</div>
<div class="col-xs-6 col-sm-2">
<fieldset class="car-type">
<input type="checkbox" name="car-type" id="EUROPEAN SEDAN" />
<label for="EUROPEAN SEDAN"><i class="icon-car-wagon"></i>EUROPEAN SEDAN</label>
</fieldset>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<fieldset>
<input type="text" name="name" placeholder="Name" />
</fieldset>
<fieldset>
<input type="email" name="email" placeholder="Email" />
</fieldset>
</div>
<div class="col-sm-3">
<fieldset>
<input type="text" name="from1" placeholder="From" />
</fieldset>
<fieldset>
<input type="text" name="to1" placeholder="To" />
</fieldset>
</div>
<div class="col-sm-3">
<fieldset>
<input type="text" name="date" placeholder="Date1" class="datepicker" />
</fieldset>
<fieldset>
<input type="text" name="time" placeholder="Time" class="timepicker" />
</fieldset>
</div>
<div class="col-sm-3">
<fieldset>
<select name="cars">
<option>Cars</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</fieldset>
<fieldset>
<select name="passengers">
<option>Passengers</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</fieldset>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<fieldset>
<textarea name="message2" placeholder="Message"></textarea>
</fieldset>
</div>
</div>
<div class="row">
<div class="col-sm-12 text-center">
<button class="btn btn-primary">Book Now</button>
</div>
</div>
</form>
you need a backend language
<!-- action->specify the destiny of data from form | method->indicate shipping method -->
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
<input type="text" name="someText" placeholder="someText">
<input type="submit" name="sendText" value="sendText">
</form>
and with php you can send the data form form
<?php
$errorMessage = ''; // case the user not complete all fields of the form
$to = 'myemail#company.com'; // destiny of message
if( isset($_POST['sendText']) ){ // comprobate the action of the input type submit
$someText = $_POST['someText']; // get the value of input type text
if( !empty($someText) ){ // comprobate if the variable is not empty
$someText = stripslashes(trim(filter_var($someText , FILTER_SANITIZE_STRING))); // this sanitize the text for avoid the code injection
mail($to,$someText); // this method only can send message when the web is working on server
}else{ // show an error message if text is empty
$errorMessage.="Please complete all fields <br>";
}
}
?>
Good day, I'm wondering why my button cannot do a submit inside phone browsers. Please take alook at my form
<form class="form-horizontal" method="POST" action="#" id ='form_id'>
<div class="form-group">
<label class="col-sm-3 control-label">Tipe</label>
<div class="col-sm-5">
<select onchange = 'by_brand();' name = 'tipenya' id="tipe" class="form-control select2">
<option value="">---</option>
<option value="AR-1">Naughty</option>
<option value="AR-6">Les Femmes</option>
<option value="AR-10">Matahari</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Area</label>
<div class="col-sm-5">
<select onchange="brands();" name ='area' id="areanya" class="form-control select2">
<option value="">All</option>
<?php foreach ($area as $areanya) {?>
<option value="<?=$areanya->AreaCode;?>"><?=$areanya->Description;?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Outlet</label>
<div class="col-sm-5">
<select name='outlet' id="hsl" class="form-control select2">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Date</label>
<div class="col-sm-5">
<input type="text" class="form-control pull-right" readonly="readonly" placeholder="Tanggal" name="date_search" id="reservation" />
</div>
</div>
<div class="box-footer pull-right">
<input type="submit" class="btn btn-submit" />
</div>
</form>
It's working fine when i use any laptop. Can anyone help me?
Here is my full html code
http://pastebin.com/KCEQzW3e
First of all try using this to test if the sumbit actually works
<form action="javascript:alert("sumbit button works!");" id='form_id'>
if this doesnt work then there is something wrong with your form.
if this works. there is something wrong with the jquery function you used.
try using this to call a function if you click submit:
<form class="form-horizontal" method="POST" action="#" id ='form_id' onsubmit="myFunction()">
I hope this helps.
I have a form, that I need my save button to be outside of form elements, but if I take it out elsewhere, it doesn`t like refresh the form.
<form ng-submit="save()" action="" name="addInv" novalidate>
<div class="col-md-10">
<label>Name:</label>
<input type="text" ng-model="newlocation.name" class="form-control">
</div>
<div class="col-md-10">
<label>Storage administrator:</label>
<select ng-model="newlocation.administrator" class="form-control" ng-options="user.resource_uri as user.first_name for user in users"></select>
</div>
<div class="col-md-6">
<label>Street:</label>
<input type="text" ng-model="newlocation.street" class="input-medium form-control">
</div>
<div class="col-md-6">
<label>City:</label>
<input type="text" ng-model="newlocation.city" class="input-medium form-control">
</div>
<div class="col-md-6">
<label>Country:</label>
<input type="text" ng-model="newlocation.country" class="input-medium form-control">
</div>
<div class="col-md-6">
<label>Postal code:</label>
<input type="text" ng-model="newlocation.postalCode" class="input-medium form-control">
</div>
<div class="col-md-6">
<button class="btn tbn-lg btn-primary">Save</button>
</div>
</form>
If I put button outside the <form> form doesn't refresh values.
You could use JavaScript to do this
<input type="submit" onclick="document.forms[0].submit();" />