I am incorporating jquery into my flask code to display autocomplete suggestions to the end-user. I used the link below as a guide.
https://www.geeksforgeeks.org/autocomplete-input-suggestion-using-python-and-flask/
The auto-complete seems to work fine while testing in Pycharm IDE i.e. auto-complete suggestions renders nicely within the UI (see screenshot below)
However - when running the the same code on my Apache Webserver, the auto-complete suggestions renders out of place within the UI (see screenshot below)
Not sure what could be causing this issue. See below for what my code looks like. Feedback appreciated.
MY FLASK-CODE
if not session.get("logged_in"):
return render_template("login.html")
else:
live_01 = gold.query.all()
return render_template("find-patient.html", live_02=live_01)
MY HTML
<html>
<head>
<title>Find Patient</title>
<h1><center><font color="white">APPLE</font></center></h1>
<br>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js">
</script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css"
rel="stylesheet" type="text/css" />
</head>
<style>
body{
background-color: #1E90FF;
}
</style>
<body>
<div><font size="4">Enter patient's ID below to locate:</font> <input type="text" id="ko" name="pid" input style="width:200px; height:35px; font-size:16px;"></div>
<script>
$( function() {
var availableTags = [
];
$( "#ko" ).autocomplete({
source: availableTags
});
} );
</script>
</body>
</html>
Via Active questions tagged javascript - Stack Overflow https://ift.tt/XGq5wQf
Comments
Post a Comment