I need to dynamically add my own custom html form tags (input, button and div) while on the add data to database screen (add page).
function Page_Render()
{
// Directly output HTML and JavaScript
$html = '<input type="text" id="isbnInput" placeholder="add ISBN" class="form-control" style="width: 200px; display: inline-block; margin-right: 10px;">
<button type="button" id="searchButton" class="btn btn-primary">Search</button>
<div id="result"></div>';
// Output the HTML
echo $html;
// JavaScript code as string
$script = <<<EOD
<script>
$(document).ready(function() {
$('#searchButton').click(function() {
var isbn = $('#isbnInput').val();
$.ajax({
url: '../istek.php',
type: 'GET',
data: { isbn: isbn },
success: function(response) {
$('#result').html(response);
},
error: function(xhr, status, error) {
$('#result').html('<p>Bir hata oluştu: ' + error + '</p>');
}
});
});
});
</script>
EOD;
// Output the JavaScript
echo $script;
}