hope all is going well, please help me with a question. I have the following form html code:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="jsexterno.js"></script>
<meta charset="utf-8">
<title>Motor de busqueda instantaneo</title>
</head>
<body>
<form id="foo1" accept-charset="utf-8" method="POST" action="gims_cd_fcom.php">
<input type="text" name="pdcode_foo1" id="pdcode_foo1" placeholder="" maxlength="30" OnKeyUp="esearch(this);"/>
<input type="text" name="pdname_foo1" id="pdname_foo1" placeholder="" maxlength="30"/>
<input type="text" name="pduom_foo1" id="pduom_foo1" placeholder="" maxlength="30"/>
<input type="text" name="pdcom_foo1" id="pdcom_foo1" placeholder="" maxlength="30"/>
<input type="hidden" name="handlerfn_foo1" id="handlerfn_foo1" value="wrt"/>
<input type="submit" id="foo1_btn" value="Agregar">
</form>
<div id="resultadoBusqueda"></div>
<div id="ShowDBReg"></div>
</body>
</html>
And I have the following JS code:
function esearch() {
var FieldtxtID = $(this).attr('id');
var FieldTxtVal = $(document).GetElementById('FieldtxtID').val();
if (FieldTxtVal != "") {
$.post("gims_cd_fcom.php", {handlerfn_foo1: 'sengine', handl_keyword: FieldTxtVal, handl_data: FieldtxtID}, function(mensaje) {
$("#ShowDBReg").html(mensaje);
});
} else {
ShwDB();
};
};
But I cannot reach the ID of txt, whats is wrong?