I am trying to send data from a form to a modal to verify the data and after proced to send, but this part of the data needs the post from thr form, and this one is not working when it call the modal, I do not know how to use ajax can someone give me a way to go with this thank you
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<?php
if ($_POST) {
$amount = $_POST['precio']*100;
echo $amount;
$miObj->setParameter("DS_MERCHANT_AMOUNT",$amount);
}
?>
<form data-toggle="modal" data-target="#myModal" method="POST" action="" >
<input name="precio" id="precio" />
<input class="btn btn-info" type="submit" >
</form>
<div class="container">
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Confirma tu compra</h4>
</div>
<div class="modal-body">
<div id="imagen">IMAGEN COMPRA</div>
<img src="" alt="mando">
<div class="details-area" id="detailsArea">
<h1 style="color:#007acc">Opciones Seleccionadas</h1>
</div>
<div class="form-group">
<label for="nombre">Nombre:</label>
<input type="name" class="form-control" id="nombre">
</div>
<div class="form-group">
<label for="apellido">Apellido</label>
<input type="name" class="form-control" id="Apellido">
</div>
<div class="form-group">
<label for="direccion">Dirección</label>
<input type="address" class="form-control" id="direccion">
</div>
<div class="form-group">
<label for="telefono">Telefono</label>
<input type="phone" class="form-control" id="telefono">
</div>
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" id="email">
</div>
<div align="right"> <h3>Total Compra <span id="AddToCartPriceID2">  $00.00</span></h3></div>
</div>
<div class="modal-footer">
<form name="frm" action="https://sis-t.redsys.es:25443/sis/realizarPago" method="POST" target="_blank" style="margin-top:10px">
<input name="DS_MERCHANT_AMOUNT" value="<?php echo $amount; ?>"/></br>
<input type="hidden" name="Ds_SignatureVersion" value="<?php echo $version; ?>"/></br>
<input type="hidden" name="Ds_MerchantParameters" value="<?php echo $params; ?>"/></br>
<input type="hidden" name="Ds_Signature" value="<?php echo $signature; ?>"/></br>
<button type="submit" class="btn btn-default" >Confirmar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</form>
</div>
</div>
</div>
</div>
</div>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<form id="frm" method="POST">
<input name="precio" id="precio" />
<input class="btn btn-info" type="submit" value="Submit" name="submit">
</form>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Confirma tu compra</h4>
</div>
<div class="modal-body">
<div id="imagen">IMAGEN COMPRA</div>
<img src="" alt="mando">
<div class="details-area" id="detailsArea">
<h1 style="color:#007acc">Opciones Seleccionadas</h1>
</div>
<div class="form-group">
<label for="nombre">Nombre:</label>
<input type="name" class="form-control" id="nombre">
</div>
<div class="form-group">
<label for="apellido">Apellido</label>
<input type="name" class="form-control" id="Apellido">
</div>
<div class="form-group">
<label for="direccion">Dirección</label>
<input type="address" class="form-control" id="direccion">
</div>
<div class="form-group">
<label for="telefono">Telefono</label>
<input type="phone" class="form-control" id="telefono">
</div>
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" id="email">
</div>
<div align="right"> <h3>Total Compra <span id="AddToCartPriceID2">  $00.00</span></h3></div>
</div>
<div class="modal-footer">
<form name="frm" action="https://sis-t.redsys.es:25443/sis/realizarPago" method="POST" target="_blank" style="margin-top:10px">
<input name="DS_MERCHANT_AMOUNT" value="<?php echo $amount; ?>"/></br>
<input type="hidden" name="Ds_SignatureVersion" value="<?php echo $version; ?>"/></br>
<input type="hidden" name="Ds_MerchantParameters" value="<?php echo $params; ?>"/></br>
<input type="hidden" name="Ds_Signature" value="<?php echo $signature; ?>"/></br>
<button type="submit" class="btn btn-default" >Confirmar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$("#frm").submit(function(e){
e.preventDefault();
$.ajax({
type : 'POST',
data: $("#frm").serialize(),
url : 'url',
success : function(data){
$("#myModal").modal("show");
}
});
return false;
});
</script>
validated_form.html
<html>
<head>
<script type="text/javascript">
function validate()
{
var error="";
var name = document.getElementById( "name_of_user" );
if( name.value != "" )
{
name = name.value;
document.getElementById( "name" ).innerHTML = name;
return false;
}
}
</script>
</head>
<body>
<form method="POST" action="getdata.php" onsubmit="return validate();">
<input type="text" name="username" id="name_of_user">
<input type="submit" name="submit_form" value="Submit">
</form>
// use id=name in your model form field
<input type="text" id="name" >
</body>
</html>
=====================================
getdata.php
<?php
if( isset( $_POST['submit_form'] ) )
{
validate_data($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = strip_tags($data);
$data = htmlspecialchars($data);
$data = mysqli_real_escape_string($data);
return $data;
}
}
?>
Related
I have a form on a page that allows users to update their information. When they click submit it presents a modal that asks them to enter their password to ensure it's them. However, once they submit the modal it doesn't POST the values to the .php to update their record.
Form and Modal
<div class="container">
<form id="updateInfo" action="update_user.php" method="POST">
<div class="form-group">
<label for "uid">User ID </label>
<input name="uid" id="uid" type="text" class="form-control" value="<?= $_SESSION['uid'] ?>" disabled>
</br>
<label for "firstname">First name </label>
<input name="firstname" id="firstname" type="text" class="form-control" value="<?= $_SESSION['firstname'] ?>">
</br>
<label for "lastname">Surname</label>
<input name="lastname" id="lastname" type="text" class="form-control" value="<?= $_SESSION['lastname'] ?>" >
</br>
<label for "email">Email </label>
<input name="email" id="email" type="email" class="form-control" value="<?= $_SESSION['email'] ?>" required pattern="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*#(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" title="Email must be in a valid format.">
</br>
<label for "username">Username</label>
<input name="username" id="username" type="text" class="form-control" value="<?= $_SESSION['user'] ?>" >
<span id="msg_username"></span>
</br>
</div>
<button class="btn btn-default" id="submit" type="button" data-toggle="modal" data-target="#myModal" >Submit</button>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Enter Password</h4>
</div>
<div class="modal-body">
<label for "password">Password</label>
<input name="password" id="password" type="password" class="form-control">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-default" action="update_user.php" data-dismiss="modal">Submit</button>
</div>
</div>
</div>
</div>
</form>
</div>
PHP file
<?php
require_once 'config.php';
$query = $conn->prepare("UPDATE users SET firstname = :firstname,lastname = :lastname,username = :username ,email = :email WHERE uid = :uid");
$query->bindParam(':firstname', $_POST['firstname']);
$query->bindParam(':lastname', $_POST['lastname']);
$query->bindParam(':username', $_POST['username']);
$query->bindParam(':email', $_POST['email']);
$query->bindParam(':uid', $_POST['uid']);
$result = $query->execute();
if($result)
{
echo "<p>Thank you. Your account has been registered.</p>";
echo $_POST['firstname'];
} else {
echo "<p>Sorry but there was a problem registering your account. Please try again.</p>";
}
?>
You should either wrap the update user button in a form or replace the action attribute by the attribute formaction.
<div class="modal-footer">
<button type="submit" class="btn btn-default" formaction="update_user.php" data-dismiss="modal">Submit</button>
</div>
See documentation of the formaction attribute here or here
Bootstrap model showing me same data in while loop. When I click any model it shows me first row data, how to fix this please help me.
Here is code
$sql="SELECT * FROM tbl_store order by store_id DESC";
$result=mysqli_query($con, $sql);
while($row=mysqli_fetch_array($result, MYSQLI_ASSOC)) {
#code here
}
HTML code
<td style="vertical-align:middle;">
<a href="#myModal1">
<button type="button" class="btn btn-warning" data-toggle="modal" data-target="#myModal1">Edit</button>
</a>
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel1">Edit Store</h4>
</div>
<div class="modal-body">
<form role="form" action="editStore.php" method="POST" enctype="multipart/form-data">
<!-- text input -->
<div class="row">
<div class="col-md-3 col-xs-3" style="text-align:right; color:#000000;">
<h6>Store Name :</h6>
<br>
<h6 style="margin-bottom:40px; margin-top:-10px;">Description:</h6>
<br>
<h6>Phone:</h6>
<br>
<h6 style="margin-top:0px;">Address:</h6>
<br>
<h6 style="margin-top:0px;">Latitude:</h6>
<br>
<h6 style="margin-top:0px;">Longitude:</h6>
<br>
<h6 style="margin-top:0px;">City:</h6>
<br>
<h6 style="margin-top:0px;">Country:</h6>
<br>
<h6 style="margin-top:0px;">Upload photo:</h6>
<p style="color:red;">*If you want to replace</p>
</div>
<div class="col-md-9 col-xs-9" style="text-align:left; color:#000000;">
<input type="text" class="input form-control" style="width:100%; margin-bottom:10px;" name="title" value="<?php echo $row['store_title']; ?>" required/>
<br>
<textarea class="input input-group" rows="3" style="width:100%; margin-bottom:10px; padding-left:10px;" name="description" required><?php echo $row['store_description']; ?></textarea>
<br>
<input type="tel" class="form-control" style="width:100%; margin-bottom:10px;" name="phone" value="<?php echo $row['store_phone']; ?>"/>
<br>
<input type="text" class="form-control" style="width:100%; margin-bottom:10px;" name="address" value="<?php echo $row['store_address']; ?>" required/>
<br>
<div class="row">
<div class="col-md-6 col-sm-12 pull-left">
<input type="text" class="form-control" style="width:100%; margin-bottom:10px;" max="180" min="0" step="0.00001" name="lat" value="<?php echo $row['store_lat']; ?>" required/>
<input type="text" class="form-control" style="width:100%; margin-bottom:10px;" max="180" min="0" step="0.00001" name="long" value="<?php echo $row['store_long']; ?>" required/>
<input type="text" class="form-control" style="width:100%; margin-bottom:10px;" name="city" value="<?php echo $row['store_city']; ?>" required/>
<input type="text" class="form-control" style="width:100%; margin-bottom:10px;" name="country" value="<?php echo $row['store_country']; ?>" required/>
</div>
<div class="col-md-6 col-sm-12 pull-right">
<img src="<?php echo $row['store_image'];?>" style="float:right;max-height:200px;max-width:200px;">
</div>
<input type="file" style="margin-left:15px; width:93%;" name="photo"/>
<input type="hidden" name="store_id" value="<?php echo $row['store_id'];?>">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" name="submit">Save changes</button>
</div>
</form>
</div>
</div>
</div>
while Looping your Target has to be unique set of id which equals to id="myModal1". eg.
//inside while loop
target="<?php echo $row['id']; ?>" and id=<?php echo $row['id'];?>
Good day! I'm trying to create modal for edit purposes. That means that it must be filled with retrieved data by specific ID. The problem is that it doesn't work.
Link used to call PHP edit function:
<span class="glyphicon glyphicon-edit"></span>
PHP edit function:
if (isset($_GET['edit'])) {
$edit = httpGet(ROOT . "/API.php?getId=" . $_GET['edit']);
?><script type="text/javascript">
$('#editId').modal('show');</script>
<?php
}
"editId" modal:
<div id="editId" class="modal fade" tabindex="1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="text-center">Edit Transaction</h1>
</div>
<div class="modal-body">
<form class="form col-md-12 center-block" action="API.php" method="post">
<div class="form-group">
<input type="text" id="id" name="id" class="form-control input-lg" placeholder="ID" value="<?php echo $edit[0]['id']; ?>">
</div>
<div class="form-group"> <select class="form-control" id="type" name="type" placeholder="Transaction type" value="<?php echo $edit[0]['type']; ?>">
<option value="withdaw">Withdraw</option>
<option value="deposit">Deposit</option>
</select></div>
<div class="form-group">
<input type="text" id="sum" name="sum" class="form-control input-lg" placeholder="Sum" value="<?php echo $edit[0]['sum']; ?>">
</div>
<div class="form-group">
<select class="form-control" id="currency" name="currency" placeholder="Currency" value="<?php echo $edit[0]['currency']; ?>">
<option value="ILS">ILS</option>
<option value="USD">USD</option>
</select></div>
<div class="form-group">
<input type="text" id="transaction" name="transaction" class="form-control input-lg" placeholder="Transaction ID" value="<?php echo $edit[0]['transaction']; ?>">
</div>
<div class="form-group">
<input type="text" id="buyer" name="buyer" class="form-control input-lg" placeholder="Buyer" value="<?php echo $edit[0]['buyer']; ?>">
</div>
<div class="form-group">
<input type="text" id="email" name="email" class="form-control input-lg" placeholder="Email" value="<?php echo $edit[0]['email']; ?>">
</div>
<div class="form-group">
<input type="text" id="invoice" name="invoice" class="form-control input-lg" placeholder="Invoice" value="<?php echo $edit[0]['invoice']; ?>">
</div>
<div class="form-group">
<input type="text" id="date" name="date" class="form-control input-lg" placeholder="Date" value="<?php echo $edit[0]['date']; ?>">
</div>
<div class="form-group">
<button class="btn btn-primary btn-lg btn-block" type="submit" value="updateId" name="updateId">Update Payment</button>
</div>
</form>
</div>
<div class="modal-footer">
<div class="col-md-12">
<button type="button" class="btn btn-default btn-lg btn-block" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
As suggested by Shukla you have to use $(document).ready(function{}); ie:
<script type="text/javascript">
$(document).ready(function{
$('#editId').modal('show');
});
</script>
Model is not appearing because function is called before html element loaded on the page. Either use ajax or use document.ready function.
I want to do is when I check the checkbox button in my dialog box the email and the password that I've typed on it will be saved and redirect to profile.php.
My problem is it doesn't work and I have an error in the inputbox that says:
Undefined index: unm and Undefined index: pwd
Does anyone here can help me with my problem?
PHP:
<?php
if(isset($_POST['login'])) {
if(isset($_POST['chkbox'])) {
setcookie("unm",$_POST['email'],time()+3600);
setcookie("pwd",$_POST['password'],time()+3600);
}
?>
<script type="text/javascript">
window.location="profile.php";
</script>
<?php
}
?>
HTML:
<a data-toggle="modal" href="#myModal"><span class="glyphicon glyphicon-user"></span> Login</a>
<div class="container">
<div class="row">
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h5 class="modal-title">PLEASE ENTER YOUR EMAIL ADDRESS AND PASSWORD TO LOG IN.</h5>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label for="email" class="col-sm-2 control-label">Email</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-envelope-o fa-fw"></i></span>
<input type="text" name="email" value="<?php echo $_COOKIE['unm'] ?>" class="form-control" placeholder="Enter Email Address..." />
</div>
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-2 control-label">Password</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key fa-fw"></i></span>
<input type="password" name="password" value="<?php echo $_COOKIE['pwd'] ?>" class="form-control" placeholder="Enter Password..." />
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="checkbox" name="chkbox" value="staylogged" class="checkbox-inline" />
<label> Keep me logged in</label> <b>|</b>
Forgot your password?
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" name="login" class="btn btn-primary"><span class="glyphicon glyphicon-user"></span> Login</button>
<button type="button" id="show_signup_md" class="btn btn-info" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-list-alt"></span> Register</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
First check if $_COOKIE['pwd'] or $_COOKIE['unm'] set at the html before echo them:
if(isset($_COOKIE['pwd']) && !empty($_COOKIE['pwd'])){
$pwd = $_COOKIE['pwd'];
}else{
$pwd = '';
}
//same for unm
if(isset($_COOKIE['unm']) && !empty($_COOKIE['unm'])){
$unm = $_COOKIE['unm'];
}else{
$unm = '';
}
then the input should be :
<input type="text" name="email" value="<?php echo $unm ?>" class="form-control" placeholder="Enter Email Address..." />
//same for pass
<input type="password" name="password" value="<?php echo $pwd ?>" class="form-control" placeholder="Enter Password..." />
Next thing don't store user details at cookies! . if do so use hashed string.
Hi im using jqBootstrapValidation to validate a form and all works well except for the password.
For example if I try to submit the form without filling in the fields it wont let me nor will it let me submit the form if email isn't in form example#site.com but even though I added data-validation-match-match tag to my second password input, the form still submit if the passwords don't match.
my code is:
<?php
$error = "";
include ('dblink.php');
session_start();
if(!empty($_SESSION['s_logged_n'])){
header("Location: index.php");
}
if($_SERVER['REQUEST_METHOD'] === 'POST')
{
if($_POST['form'] === 'login')
{
$username = mysqli_escape_string($con, trim($_POST['user']));
$password = md5(trim($_POST['password']));
$query = mysqli_query($con,"SELECT * FROM Users WHERE Username = '$username' AND Password = '$password' LIMIT 1") or die(mysql_error());
$row = mysqli_fetch_array($query);
// now we check if they are activated
if(mysqli_num_rows($query) > 0)
{
if($row['Activated'] > 0)
{
$_SESSION['s_logged_n'] = 'true';
$_SESSION['s_username'] = $username;
$_SESSION['s_name'] = $row['Name'];
header("Location: index.php");
}else
{
$error = "<Br><div class=\"alert alert-warning\">Your account hasnt yet been activated.</div>";
}
}
else
{
$error = "<Br><div class=\"alert alert-danger\">Your username/password do not match.</div>";
}
}
if($_POST['form'] === 'register')
{
$first = addslashes(trim($_POST['fname']));
$surname = addslashes(trim($_POST['lname']));
$abr = mb_substr($surname, 0, 3);
$username = $first . $abr;
$email = addslashes(trim($_POST['email']));
$poste = addslashes(trim($_POST['poste']));
$pass = addslashes(trim($_POST['pass']));
$salary = addslashes(trim($_POST['salary']));
$conf = addslashes(trim($_POST['cpass']));
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("d, m y");
$password = md5($pass);
}
}
?>
<DOCTYPE html>
<html>
<head>
<link href="css/bootstrap-theme.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="http://eonasdan.github.io/bootstrap-datetimepicker/styles/bootstrap-datetimepicker.min.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jqBootstrapValidation.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://eonasdan.github.io/bootstrap-datetimepicker/scripts/moment.js"></script>
<script type="text/javascript" src="http://eonasdan.github.io/bootstrap-datetimepicker/scripts/bootstrap-datetimepicker.js"></script>
<script>
$(function () { $("input,select,textarea").not("[type=submit]").jqBootstrapValidation(); } );
</script>
<body >
<div style="background-color:#CC0000; height: 100%" >
</br>
</br>
</br>
<div class="container">
<div class="panel panel-default" >
<div class="panel-body">
<div class="page-header">
<h1>Login</small></h1>
</div>
<form class="form-horizontal" role="form" action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span>
</span>
<input name="user" type="text" class="form-control" placeholder="Username">
</div></br>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span>
</span>
<input name="password" type="password" class="form-control" placeholder="Password">
</div>
<?php echo $error;?>
<div class="form-group">
<div class="col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<input type="hidden" name="form" value="login" />
<button type="submit" id="login" name="login" class="btn btn-default">Sign in</button><button type="button" data-toggle="modal" data-target="#register" class="btn btn-warning btn-xs">Register</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="register" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Registration</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form" action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
<div class="form-group">
<label for="fname" class="col-sm-3 control-label">First Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="fname" name="fname" placeholder="Your first name." required>
</div>
</div>
<div class="form-group">
<label for="lname" class="col-sm-3 control-label">Last Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="lname" name="id="lname"" placeholder="Your last name." required>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="email" name="email" placeholder="Your email." required>
</div>
</div>
<div class="form-group">
<label for="poste" class="col-sm-3 control-label">Poste</label>
<div class="col-sm-9">
<select class="form-control" id="poste" name="poste">
<option value="Surface de Vente">Surface de Vente</option>
<option value="Caisse">Caisse</option>
<option value="Protection des biens">Protection des biens</option>
<option value="Circulation des marchandises">Circulation des marchandises</option>
<option value="Préposé à la marque">Préposé à la marque</option>
<option value="Réserve">Réserve</option>
<option value="Électronique">Électronique</option>
<option value="Biens Modes">Biens Modes</option>
<option value="Starbucks">Starbucks</option>
<option value="Ressources humaines">Ressources humaines</option>
</select>
</div>
</div>
<div class="form-group">
<label for="salary" class="col-sm-3 control-label">Salary</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="salary" name="salary" placeholder="Your salary." required>
</div>
</div>
<div class="form-group">
<label for="pass" class="col-sm-3 control-label">Password</label >
<div class="col-sm-9">
<input type="password" minlength="6" class="form-control" id="pass" name="pass" required>
</div>
</div>
<div class="form-group">
<label for="cpass" class="col-sm-3 control-label">Confirm</label>
<div class="col-sm-9">
<input type="password" minlength="6" class="form-control" id="cpass" name="cpass" data-validation-match-match="pass" required>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<input type="hidden" name="form" value="register" />
<button type="submit" class="btn btn-danger">Register <span class="glyphicon glyphicon-ok"></span></button>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</body>
</html>
the form, which is in there is:
<form class="form-horizontal" role="form" action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
<div class="form-group">
<label for="fname" class="col-sm-3 control-label">First Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="fname" name="fname" placeholder="Your first name." required>
</div>
</div>
<div class="form-group">
<label for="lname" class="col-sm-3 control-label">Last Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="lname" name="id="lname"" placeholder="Your last name." required>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="email" name="email" placeholder="Your email." required>
</div>
</div>
<div class="form-group">
<label for="poste" class="col-sm-3 control-label">Poste</label>
<div class="col-sm-9">
<select class="form-control" id="poste" name="poste">
<option value="Surface de Vente">Surface de Vente</option>
<option value="Caisse">Caisse</option>
<option value="Protection des biens">Protection des biens</option>
<option value="Circulation des marchandises">Circulation des marchandises</option>
<option value="Préposé à la marque">Préposé à la marque</option>
<option value="Réserve">Réserve</option>
<option value="Électronique">Électronique</option>
<option value="Biens Modes">Biens Modes</option>
<option value="Starbucks">Starbucks</option>
<option value="Ressources humaines">Ressources humaines</option>
</select>
</div>
</div>
<div class="form-group">
<label for="salary" class="col-sm-3 control-label">Salary</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="salary" name="salary" placeholder="Your salary." required>
</div>
</div>
<div class="form-group">
<label for="pass" class="col-sm-3 control-label">Password</label >
<div class="col-sm-9">
<input type="password" minlength="6" class="form-control" id="pass" name="pass" required>
</div>
</div>
<div class="form-group">
<label for="cpass" class="col-sm-3 control-label">Confirm</label>
<div class="col-sm-9">
<input type="password" minlength="6" class="form-control" id="cpass" name="cpass" data-validation-match-match="pass" required>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<input type="hidden" name="form" value="register" />
<button type="submit" class="btn btn-danger">Register <span class="glyphicon glyphicon-ok"></span></button>
</form>
and the javascript is:
<script>
$(function () { $("input,select,textarea").not("[type=submit]").jqBootstrapValidation(); } );
</script>
I get no error in my js console and I dont see what the error could be, anyone is familiar with this?
Also its ignoring the min character.