I have a problem when obtaining the values of a form through the POST method to a PHP.
The form is in a modal window created with BootStrap:
<form action='../php/editCardPatient.php' method='POST' role="form" data-toggle="validator">
<div class="row form-group">
<div class="col-xs-6 col-sm-6">
<label for="inputName" class="control-label">Nombre</label>
<input name='name' type="text" class="form-control" id="name" value="<?php
if(isset($_SESSION["name_patient"])) {
echo $_SESSION["name_patient"];
}?>" required disabled>
</div>
</div>
<div class="modal-footer" id='buttonAccept' style="display: none;">
<button type="button" class="btn btn-primary" onclick="funcionCancelCard()">Cancelar</button>
<button type='submit' value='EditAcc' class="btn btn-primary" onclick="funcionButtons()">Aceptar</button>
</div></form>
And in the editCardPatient.php file, the first thing I do is declare the variables:
/* Recogemos las variables introducidas en el formulario de patientCard.php */
$nameCardPatient = trim($_POST['name']);
/* Creamos la conexión BD */
include("../php/conectionBD.php");
session_start();
The problem is that on the page, when I press the button to submit the form I get an error on the PHP page:
Can you think of what it could be?
The problem is that the field is disabled, disabled fields are not submitted by the form. Instead of disabling it you can just put it in "read mode".