Background:
I have created a very simple front end, where the user can input strings. Once entered and "check" button is clicked, I would like to pass this string as a JSON to a python string where it will do a SQL look up. Based on the SQL look the python script should pass a boolean value which should change the ? to a ✔ or a ✘.
Question:
How can I pass on a string once the "check' button is pressed as a JSON to a Python script, and pass a Boolean from Python to HTML to change the ? to a ✔ or a ✘?
Research:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
h3 {text-align: center;}
.center {
display: flex;
justify-content: center;
align-items: center;
}
</style>
</style>
</head>
<body>
<h3>My Request</h3>
<div class="container">
<form action="/action_page.php">
<label for="account_name">? Account Name:</label>
<input type="text" id="fname" name="firstname" placeholder="Account Name..">
<input type="submit" value="Check Account"><br><br>
<label for="contact_name">? Contact Name:</label>
<input type="text" id="lname" name="lastname" placeholder="Contact Name..">
<input type="submit" value="Check Contact"><br><br>
<label for="reseller">? Reseller:</label>
<input type="text" id="lname" name="lastname" placeholder="Reseller..">
<input type="submit" value="Check Reseller"><br><br>
<label for="issue_date">? Issue Date:</label><br>
<input type="date" id="start" name="trip-start" value="" min="2018-01-01" max="2100-12-31">
<br>
<div class="center">
<input type="submit" value="VERIFY ALL">
</div>
</form>
</div>
</body>
</html>