I am just wondering if you could help me with my problem.
Below is my code where I get to save a data in bullet form like this
I'm using the code below for my project
<script>
$(".note").focus(function() {
if(document.getElementById('note').value === ''){
document.getElementById('note').value +='• ';
}
});
$(".note").keyup(function(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
document.getElementById('note').value +='• ';
}
var txtval = document.getElementById('note').value;
if(txtval.substr(txtval.length - 1) == '\n'){
document.getElementById('note').value = txtval.substring(0,txtval.length - 1);
}
});
</script>
<script>
$(".prescription").focus(function() {
if(document.getElementById('prescription').value === ''){
document.getElementById('prescription').value +='• ';
}
});
$(".prescription").keyup(function(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
document.getElementById('prescription').value +='• ';
}
var txtval = document.getElementById('prescription').value;
if(txtval.substr(txtval.length - 1) == '\n'){
document.getElementById('prescription').value = txtval.substring(0,txtval.length - 1);
}
});
</script>
<?php
include("db.php"); ?>
<?php
$sqlsearch;
$row;
$sqlsearch="";
$message="";
$conid="";
$patient_id="";
$lname="";
$mi="";
$fname="";
$suffix="";
$sql = "SELECT
patient.lname,
patient.fname,
patient.mi,
patient.suffix
FROM
patient
WHERE
patient.patient_id= '".$_REQUEST['patient_id']."'";
$result = mysqli_query($conn,$sql);
while($row = mysqli_fetch_array($result)){
$lname = $row['lname'];
$fname = $row['fname'];
$mi = $row['mi'];
$suffix = $row['suffix'];
echo "<tbody><tr>";
echo "<td> <h5> Patient's name: <u>" . $fname ." " . $mi .". " . $lname ." " . $suffix ."</u></h5></td></tr>";
}
?>
<form method="POST" action="">
<textarea id="note" class="form-control note" name="note" id="note" rows="10" placeholder="" required=""></textarea><br><br>
<textarea id="prescription" class="form-control prescription" id="note" name="prescription" rows="10" placeholder="" required=""></textarea>
</form>
The result in my SQL query is this
Now my problem is that, this string '•' is also saved in the database with my data and I don't know where this came from. Can you guys point out where I got wrong in my coding?